By kim.pepper on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.3.x
Introduced in version:
10.3.0
Issue links:
Description:
\Drupal\file\Plugin\rest\resource\FileUploadResource no longer duplicates file upload logic, and re-uses the \Drupal\file\Upload\FileUploadHandler.
As such the constructor for FileUploadResource has changed.
Before:
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
$serializer_formats,
LoggerInterface $logger,
FileSystemInterface $file_system,
EntityTypeManagerInterface $entity_type_manager,
EntityFieldManagerInterface $entity_field_manager,
AccountInterface $current_user,
$mime_type_guesser,
Token $token,
LockBackendInterface $lock,
Config $system_file_config,
EventDispatcherInterface $event_dispatcher,
FileValidatorInterface $file_validator = NULL,
)
After:
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
$serializer_formats,
LoggerInterface $logger,
protected FileSystemInterface $fileSystem,
protected EntityTypeManagerInterface $entityTypeManager,
protected EntityFieldManagerInterface $entityFieldManager,
protected FileValidatorInterface $fileValidator,
protected InputStreamFileWriterInterface $inputStreamFileWriter,
protected FileUploadHandler $fileUploadHandler,
)
Comments
Are there examples on how to handle fileuploads now?
I miss an example on how to handle file uploads now.
Example of old working solution.
How can this be done with the new logic?