Change file extenstion with upload class - 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: Change file extenstion with upload class (/showthread.php?tid=26387) |
Change file extenstion with upload class - El Forum - 01-12-2010 [eluser]dorwin[/eluser] Hello, I see I can rename a just uploaded file with this class : Quote:file_name Desired file nameBut is it possible to change file extension, like .JPG in .jpg without use ftp class ? Because sometimes servers bug if mypic.JPG is called by <img src='mypic.jpg' /> Thanks ! Change file extenstion with upload class - El Forum - 01-12-2010 [eluser]danmontgomery[/eluser] You can use rename() to rename the file once it's been uploaded: http://php.net/manual/en/function.rename.php Change file extenstion with upload class - El Forum - 01-12-2010 [eluser]dorwin[/eluser] Too willing to use CodiIgniter, we come to forget base php Code: rename($image['full_path'], strtolower($image['full_path'])); |