Page 1 of 1

Uploads Module - how to modify the filename? [solved]

Posted: Fri Mar 04, 2011 7:35 am
by blackhawk
Is there a way with the uploads module that I can add a string to the filename once its uploaded? Wether or not if the feu uploads his or her file with its original name or decides to rename it, I just need away to add something in front of thier filename. For example if the file being uploaded is...

Code: Select all

cat.jpg
Then I need to have the smarty date or php date function in front of it...

Code: Select all

20110304074901cat.jpg
I know how to build the date function in php and smarty. I just don't know which file to manupulate in order to make this all happen. Any suggestions will be great!


OR if it makes life easier, an aternative idea I had was to take the fake name that uploaders use for their file being uploaded and add it to the original filename rather than replacing it. Is this possible?

bh

bh

Re: Uploads Module - how to modify the filename?

Posted: Fri Mar 04, 2011 6:25 pm
by blackhawk
I'm still looking for a way to pass a string or variable to the original filename when a file is uploaded. I am sure this is not a huge task, but a simple passing of a php variable. can anyone give me any pointers on how to do just that with the uploads module so that the filename is modified after the file is copied to the proper folder?

I just need a little bit of direction
thanks!

Re: Uploads Module - how to modify the filename?

Posted: Sun Mar 06, 2011 2:42 am
by blackhawk
Thank you for the $filePrefix, works like a charm!

Re: Uploads Module - how to modify the filename? [solved]

Posted: Wed Aug 17, 2011 9:01 pm
by Tino
Blackhawk - can you provide a little more detail about how you used the $filePrefix please as I have a similar problem to you.

Thanks,
Tino