Welcome Guest, Not a member yet? Register   Sign In
File Upload Class: Pass in new file name
#3

[eluser]jamesf[/eluser]
I've just come across the same problem, luckily I had already created a "MY_Upload" class and I simply copied over the "do_upload" method and added some code to change the filename like this:

Code:
// if a new file name was set
if($new_file_name != null) {
    $this->file_name = $new_file_name;
}

This was inserted before the method validates the filename for an existing file with the same name. Works like a charm.


Messages In This Thread
File Upload Class: Pass in new file name - by El Forum - 06-24-2008, 07:28 AM
File Upload Class: Pass in new file name - by El Forum - 06-25-2008, 08:42 PM
File Upload Class: Pass in new file name - by El Forum - 06-26-2008, 02:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB