Welcome Guest, Not a member yet? Register   Sign In
Append file name on Upload
#1

[eluser]timj[/eluser]
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?
#2

[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.
#3

[eluser]timj[/eluser]
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.
#4

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




Theme © iAndrew 2016 - Forum software by © MyBB