The files folder is currently a place where Drupal puts whatever is upload through its upload system.
The problem is that all files are mixed in one folder. For sites with thousands of nodes, it quickly becomes a problem to not have a more advanced hierarchy.
The idea is that Drupal should allow the administrator to optionally specify a subfolder in any different form that allows file uploading and for any defined taxonomy.
Comments
Comment #1
webchickYeah, it probably should; however, new features only go into the development version.
In the meantime you could do this with a module that acts on hook_nodeapi op submit and switches the file destination.
Comment #2
umonkey commentedTaxonomy is of no use here. I believe there should be a folder per node, user, theme etc.
Comment #3
pasqualleComment #4
neural commentedWhy not "content type/nodeid"?
The files folder would then look like this:
-..
-forum
----nodeid1
----nodeid2
-page
----nodeid3
----nodeid4
-story
----nodeid1
----nodeid2
-themes
----garland
----bluemarine
-user
----username1
----username2
The themes folder would hold logos and other theme related files.
The user folder would hold profile pictures and other files related to users.
Comment #5
dopry commentedbecause files are not strictly associated to nodes... I recommend a hash on the first few letters of a filename. Say
/path/to/file.jpg becoming /path/to/f/i/l/file.jpg. You could also implement this as a stream wrapper around the normal file handling.
Comment #6
webchickThat makes for icky user-facing URLs.
Since this is one of those "everybody's got a use case" problems, it'd make the most sense to make this user-configurable in the same way that FileField does.
Ideally, this would involve #113614: Add centralized token/placeholder substitution to core, but even if upload.module was allowed to be configured per-node-type with a hard-coded filepath (art, photos, etc.), that would be a vast improvement.
Comment #7
dave reidThis is now solved in Drupal 7 core. The file upload directory now allows tokens and other contrib modules allow even more exhaustive solutions.