CodeIgniter Forums

Full Version: save image extension as lower case instead of myimage.JPG upper case
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Upload.php in the library saves the extensions in upper case, if the source file is originally saved as uppercase. Is there change I can make in the Upload.php in the standard lib,so it saves it as lowercase? as apache is case sensitive, references to file in lower case are not shown.

I didn't include this code as it's too long.


El Forum

You can extend the Upload class set_filename function to use the strtolower function.
Or you can set the filename yourself using this option:

file_name None Desired file name

If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.