It would be a nice feature to add maybe a drop down or a text field which allows users with the correct privileges to set the directory for where files for that node will be uploaded.
It would be a nice feature to add maybe a drop down or a text field which allows users with the correct privileges to set the directory for where files for that node will be uploaded.
Comments
Comment #1
Farreres commentedYES YES YES please!!!!
Not only this. Some way so that we can decide the naming of the directory. It's a mess that all uploaded files sit in the main files directory.
It would be nice that we could specify that images uploaded went into a file named via some pattern:
[node-type]+[nodeid]+[owner name]
That way we could organize files in some controllable way. Now they sit in files directory and it's a mess, really uncontrollable.
Comment #2
MPiccinato commentedI am working on implementing a drop down of sub directories based on what the default directory is set to when the field is created.
Comment #3
dopry commented@Farreres: Try using tokenized paths. There is patch for token.module to use site dates that provides very effective directory hashing. Too many files in one dir is actually a performance problem. This is the currently available solution. You can also use uid via the token module with its current release.
NodeType/Node ID will not be supported since files are not always related to nodes and as of D6 are no longer directly tied to and NID via the files table.
Comment #4
Farreres commented@dopry: I see some other patch that tries to offer node tokens. I have read in some replies from your part that node tokes wouldn't be available because a node is not created as images are uploaded via imagefield. I suppose something can be worked out to know if the node is an existing one or not, and giving node tokens in case the node exists. This would permit creating paths depending on node author's uid and such. But as I see, this patch is already going to be committed (http://drupal.org/node/260045)
Comment #5
ajayg commentedAny suggestion/experience using group id and token to save files? I had earlier opened an issue #268744: provide a per node directoy to attach files which after solving can be a great substitute for OG Gallery.
Comment #6
quicksketchYou can already do this with the FileField Tokens module.