Append file name on Upload

Hello, I am building a file Upload utility and would like to be able to modify the filename upon upload. The filename would be appended with the date of the upload. New to this.

I see that orig_name is included in the Upload Class data array. I also see that the functionality to easily change a file name is built into the FTP Class. I don't see that it is built into the Upload Class.

So my question is, should I be using the Upload or FTP class to achieve this result? Is appended_name something I can just add into the Upload Class data helper array?

[eluser]Ben Edmunds[/eluser]
It's already there.

Just set $config['file_name'].

If you have problems check line 933 in the upload library and make sure it is checking for $this->file_name.

Thanks; handy.

But it doesn't seem to *quite* get to my problem, which is keeping the default file name while appending a date. If I rename the file_name, it overwrites the orig_name. What I'd like to do is keep the orig_name but append a date to the file_name.

[eluser]Ben Edmunds[/eluser]
To do that you'd probably be best off extending the upload library.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.