I'm trying to upload pictures with personalized names. If somebody uploads a picture to some project, I want this personalized name: Project_imageX.jpg, where X is the number of the image. This number is controlled with a counter in my code, but it doesn't matter.
I read about the parameters that the function do_upload() supports, so, I tried to do something like this:
$this->upload->do_upload('form_name',$my_name);
the variable $my_name is filled with the structure specified before. But it doesn't work.
Do you know what I'm doing wrong?
Thak you all!
do_upload()only takes one parameter. You want to edit thefile_namevalue in the$configarray before you call$this->upload->initialize. See: ellislab.com/codeigniter/user-guide/libraries/…rename($data['full_path'], $data['file_path'].$new_name);move_uploaded_file()). So, it just puts the file on your server. If you rename it, it'll be renamed. FTP is just another way to access the files.