Drupal\file\Plugin\rest\resource\FileUploadResource->post()
has a lot of useful file handling code which can be reused. Currently it's tied to the Field API with lines such as $destination = $this->getUploadLocation($field_definition->getSettings());
. This prevents its use when not using the field API (e.g. Webform).
While $field_definition->getSettings()
is the most obvious, there could be others. Removing this from the post()
method means it would be possible to extend the class and only need to override some helper methods, such as getUploadLocation()
and validateAndLoadFieldDefinition()
.
Let me know if I need to provide further information or a specific use case.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.