Picture
Minnur Yunusov Senior Drupal Developer Follow
September 8, 2015

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.

See on Drupal.org

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.

 

Requirements

No other dependencies all required modules are in core.

Quick Start

  1. Enable the module.
  2. Configure File Chooser Field settings (open admin/config/media/file-chooser-field).
  3. Edit your File and Image fields and enable "Enable third party file uploads" checkbox.
  4. Configure permissions.

Plugin API

  1. Implement hook_file_chooser_field_plugins().
  2. Create a new class by extending FileChooserFieldPlugin class (see plugins/PluginBase.php).
  3. Enable the plugin (open admin/config/media/file-chooser-field).

Roadmap

  • 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.