I have a very large listing of files in my 'file attach' folder with many sub-folders. Some of the files in different sub-folders also have the same name. It would be very helpful to display the sub-folder path on the file attach select file listing pull-down. The pull-down box width could be expanded and the sub-folder names also displayed. If you are willing to add this feature you may also want to add a little logic to truncate the middle if the path/filename length becomes too long, while still sorting the list properly.
Currently I am using 'drupal.org/project/webfm' because it has a full-featured file system browser, but I would like to move to 'filefield_sources' because it has a larger user base, more features, and functions better on my website. Adding the path to the file attach listing seems like a simple addition to solve my need and perhaps others as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | filefield_sources_attach_sub-d6.patch | 547 bytes | quicksketch |
| #2 | filefield_sources_attach_sub-d7.patch | 502 bytes | quicksketch |
Comments
Comment #1
quicksketchI don't think FileField Sources is a good fit for your needs if you have a very large directory of files (or at least the "Attach" source is not suitable). I'd recommend using another source like IMCE if you need to browse a large number of files. That said, I don't think adding the subdirectory name in front of nested files would be a bad idea. I'll see if this is an easy thing to accomplish.
Comment #2
quicksketchThis turned out to be rather trivial. In D6 I used preg_replace() because certain base paths might be repeated in the sub directory structure (i.e. "files" might accidentally replace twice in a path like "files/file_attach/user_1/files/example.png". In D7, I simply used str_replace since all files are prefixed with the schema, such as "public://", which is unlikely (or impossible) to be repeated within a file name.
Comment #3
quicksketch