Is there any way to make the "image" module store files under a new name on upload? Basically, someone could upload a file that says something like "macs are cool" or something equally absurd. Now, I don't want people to see that. I'd much rather have all the files renamed on upload to something like: "111494949478383.jpg". How would I go about accomplishing this?
A:
there are file modules that basically use tokens to do this
edit also imagefield supports tokens http://drupal.org/node/152640 immagefield could be better in long run if cck going to Drupal 7
hope that helps
That is for FOLDER names, not FILENAMES.
RD
2009-08-21 05:23:16
A:
with hook_nodeapi you could move the files and rename the images when the node is saved.
Or you could add something to the image upload callback with hook form alter to rename the image once it has been uploaded
Jeremy French
2009-08-21 13:25:38
+1
A:
The FileField Paths module should do what you want. It works with both core Upload, as well as the FileField and Imagefield modules. You may also want to check out Imagefield Tokens, which allows the use of node tokens in things like the default alt text for images.
jhedstrom
2009-12-09 00:00:04