I always wanted some kind of tool in Drupal that would allow me to upload files from third-party services.
There are quite a few modules that would allow me to upload files but none of them worked well for me. Either they asked me to put the URL or they would just store URL's to remote files.
Because of lack of such a module on Drupal.org I came up with the idea of creating a module that would combine several services and have ability to download files and use them in Drupal specified fields.
After spending several days I was able to create a working prototype and eventually released a module called File Chooser Field.
The module extends File and Image fields by adding ability to upload files from third-party services such as Dropbox, Box, OneDrive, Google Drive and Instagram. The module's built-in plugin API allows developers extend functionality of the module by integrating other service providers.
The module respects Drupal field settings such as file size limit, extensions, cardinality.
You have to note that this module downloads remote files and stores them in the Drupal field.
No other dependencies all required modules are in core.
- Enable the module.
- Configure File Chooser Field settings (open admin/config/media/file-chooser-field).
- Edit your File and Image fields and enable "Enable third party file uploads" checkbox.
- Configure permissions.
- Implement hook_file_chooser_field_plugins().
- Create a new class by extending FileChooserFieldPlugin class (see plugins/PluginBase.php).
- Enable the plugin (open admin/config/media/file-chooser-field).
- Drupal 8 version of the module.
- More third-party service plugin integrations.
Download the module and see file_chooser_field.api.php file for all available hooks.