0

Is it possible to replace/prepend the file name on upload with some member data?

For example original file is called file_data.zip but then prepend the filename with third_hyperion_991 leaving third_hyperion_991_file_data.zip

1 Answer 1

0

https://ellislab.com/expressionengine/user-guide/development/extension_hooks/global/filemanager/index.html#file-after-save

http://php.net/manual/en/function.rename.php

Suggestion: Use the file_after_save hook to simply rename the file in a custom extension. You will then have to update the related file info in the database (and probably where it's connections live in your channel data rows).

This assumes you are using a native file field in FreeForm. If you're using an assets field, the hook might be different. If using assets, one of these suckers will be your prize:

http://docs.pixelandtonic.com/assets/developers/hooks/index.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.