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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

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

Post 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
Last edited by blackhawk on Sun Mar 06, 2011 2:43 am, edited 1 time in total.
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

Re: Uploads Module - how to modify the filename?

Post 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!
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

Re: Uploads Module - how to modify the filename?

Post by blackhawk »

Thank you for the $filePrefix, works like a charm!
Tino
Forum Members
Forum Members
Posts: 44
Joined: Mon Apr 28, 2008 7:58 pm

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

Post 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
Post Reply

Return to “Modules/Add-Ons”