![]() |
[solved] get latest file name after uploading file - 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: [solved] get latest file name after uploading file (/showthread.php?tid=22458) |
[solved] get latest file name after uploading file - El Forum - 09-10-2009 [eluser]dimazarno[/eluser] Hi, everyone.. i have a bit question, i'm just try to upload image using file uploading class, and it works perfectly. but now i have no idea how to get the latest file_name after auto renaming files. example: 1. upload ci.jpg 2. upload ci.jpg again then its automatically numbered, so become ci1.jpg my question is how to get the name ci1.jpg so i can put it on database. thanks. [solved] get latest file name after uploading file - El Forum - 09-10-2009 [eluser]BrianDHall[/eluser] Check out the File Uploading Class Quote:$this->upload->data() Orig_name being the original name, as otherwise (such as in the path) you get the new name. [solved] get latest file name after uploading file - El Forum - 09-10-2009 [eluser]dimazarno[/eluser] thanks for your reply, is it any query maybe something like these : $this->upload->data('file_name'); sorry i'm still newbie here.. [solved] get latest file name after uploading file - El Forum - 09-10-2009 [eluser]BrianDHall[/eluser] Almost: Code: $data = $this->upload->data(); upload->data() returns an array with all that info in it. You can use var_dump($data) with the above code to get a better feel for all the information the file upload class returns. [solved] get latest file name after uploading file - El Forum - 09-10-2009 [eluser]dimazarno[/eluser] Thanks Brian, it's solved now :-) |