![]() |
file upload class - problem with file_name config item - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: file upload class - problem with file_name config item (/showthread.php?tid=30862) |
file upload class - problem with file_name config item - El Forum - 05-28-2010 [eluser]Berik[/eluser] Hi there, Not sure if this is a bug or a misunderstanding on my part but when initialising the upload class with the file_name config item, the uploaded file is not renamed to what I feed it (it keeps the original file name). Here's my upload function (within a controller): Code: function _upload() Any clue on what I could be doing wrong? file upload class - problem with file_name config item - El Forum - 05-28-2010 [eluser]vaxis[/eluser] Try to remove $config['overwrite'] = FALSE; and see if you have same problem. file upload class - problem with file_name config item - El Forum - 05-28-2010 [eluser]Berik[/eluser] [quote author="vaxis" date="1275055944"]Try to remove $config['overwrite'] = FALSE; and see if you have same problem.[/quote] yup, same problem ![]() On a sidenote, the reason why I'm using $config['overwrite'] = FALSE is because this will become a multiple file upload (once I get it working on a single file) and this directive increments the file names. Just thought I should make a precision on that ![]() file upload class - problem with file_name config item - El Forum - 05-28-2010 [eluser]vaxis[/eluser] See the code below(i use it for uploading one image) hope it will help you. Code: # CATEGORY IMAGE file upload class - problem with file_name config item - El Forum - 05-28-2010 [eluser]Clooner[/eluser] Make sure it is a filename without the fileextension! file upload class - problem with file_name config item - El Forum - 05-28-2010 [eluser]Berik[/eluser] Thanks vaxis, had to rush out so didn't have time to try your code... will do that asap and come back to post the results. file upload class - problem with file_name config item - El Forum - 05-30-2010 [eluser]Berik[/eluser] Tried your script vaxis and still no renaming... arghhh! Could be me but I believe there's a bug with the file_name config item. I guess I'll just have to correctly name my files before uploading them as I don't have too much time to spend on working out the issue. Since it's for a personnal project that only I will use it's not too important. It would be if it where for a client project though, so eventually I will have to get around to finding out what is going on. Thanks for your help anyway ![]() file upload class - problem with file_name config item - El Forum - 08-02-2010 [eluser]onepieceartist[/eluser] i've got the same darned infuriating problem - did you get to the bottom of it Berik?? file upload class - problem with file_name config item - El Forum - 08-02-2010 [eluser]mlage[/eluser] Here is a guess... but try setting write over to TRUE... perhaps to rename a file... you must write over the original? |