Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By drupalz001 on
I wish to rename the files and change the directory on upload.
I have an image field which allow multiple upload by using Plupload integration module.
By using the hook_file_validate, i able to change the filename, uri, destination in the $file object and leave the rest as it is, it seems ok. Images are showing in the node, data in database is fine.
My question is this a proper way? Any hidden problems i might face in future?
Please let me know if you have any suggestion.
Thanks!
Comments
Use the upload vailidators
this seems to be a better way
this seems to be a better way, thanks a lot!
Your welcome
Your welcome