Renaming file in upload |
[eluser]ojcarga[/eluser]
I am not sure if that is possible, cause the $config[] array must be set before the do_upload() method. So in that point, we don't have the file information yet, I guess that is the workflow. I see two ways: 1) After the do_upload() method and if it succeed use the helper http://ellislab.com/codeigniter/user-gui...elper.html to manage the new file, knowing that we have the information related to it with this method $this->upload->data() 2) Easier is to have a hidden input in the view and catch the filename of the file the user selected with Javascript, and then in the controller before setting and loading the library - $this->load->library('upload', $config); - we can have the filename and add it to $config[] array. |
Messages In This Thread |
Renaming file in upload - by El Forum - 05-02-2012, 08:09 AM
Renaming file in upload - by El Forum - 05-02-2012, 08:43 AM
|