Drupal - change name of uploaded images to random alphanumeric long string
I've noticed tha开发者_如何学运维t it is a common functionality within public sites to change the name of uploaded pictures to a long, 'random', alphanumeric string. This is good for privacy etc.
I can't find a module within Drupal that achieves this, and was wondering if it was possible. This would need to operate before modules like ImageCache.
???
I think there're no modules that does exactly what you're looking for, but i can suggest a way to achieve this using code. There's a module called filefield_paths which makes you able to change the name of imagefield files with a token, provided by the token module. Looking into the code of this module you can see how it works and make your own small module to achieve the same result with an alphanumeric string.
In detail, the function you're looking for is here, at line 457. I can't provide a directly working solution as I need time to write and test the code, however this is a very good starting point.
精彩评论