Attached patch (git-generated) adds the option to rename the image file according to a spec like the 'Image path' setting. Also, a more shaky feature, the spec is evaluated against node tokens (if node is available).
e.g.
specifying '[user]-[date-in-tz]' for 'Image file name' will rename complicated_and_unnecessary_filename_(22).jpg to [user]-[date-in-tz].jpg
Using this in production; UI may need a tweak.
Cheers
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | imagefield_base_filename_v3.patch | 2.68 KB | Vuds |
| #3 | base_filename_v2.patch | 2.68 KB | k8n |
| base_filename.patch | 2.54 KB | k8n |
Comments
Comment #1
Farreres commentedHey, could you add also support for this? http://drupal.org/node/259263
Comment #2
dopry commented@k8n: Strip the the node token options and this can go in... I'm generally adverse to altering user input, but there has been enough demand for this that I will entertain it.
Comment #3
k8n commented@dopry: Done and done.
Comment #4
k8n commentedComment #5
Vuds commentedHi k8n and dopry,
I've tried to use the patch but I saw that it was not working with user tokens, just the globals. Here you go it corrected.
PS: I've made another version for me yet, adding the possibility to use node tokens too (I was more thinking to use nid to identify the files) and adjusted the module to use with the paths too. It worked very well. If you think it's a good thing, I can upload this patch too.
Thanks!
Comment #6
whisk commentedThat will be quite interesting and useful, Vuds!
Comment #7
quicksketchThis won't be applied to the 5.x version, which is now maintenance only. In Drupal 6 you can use the FileField Paths module to accomplish the same thing.