Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there any option to link to an existing file and do not move/copy the file to the drupal files directory?
Existing file in /mount/media/pictures/picture_1.jpg
and reference this picture with filefield_sources widget and do not move/copy the file to the drupal dir.
The request serves the file from /mount/... directory.
Thanks
Comments
Comment #1
drupal a11y CreditAttribution: drupal a11y commentedThis feature would be great!
Comment #2
millenniumtreeI just discovered the "Autocomplete reference textfield" option.
This works as long as the file is in your File System path. (sites/*/files, or whatever you have configured)
This is especially useful for large files (like videos), as it doesn't make a copy of the file. It's exactly what I needed.
Linking instead of copying improves efficiency of any reverse proxy you might have, or just browser caching in general.
Comment #3
profak CreditAttribution: profak as a volunteer commentedUnfortunately all files for linking must be under Drupal private/public files. You can switch for private files and can tell Drupal where to search/store files (even outside Drupal root). FileField Sources already has support for Drupal private files.