turtlewolf — 2012-12-11T15:44:42-05:00 — #1
I've followed the tutorial at http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-file-uploading-and-image-manipulation/ , and it has worked wonderfully. Unfortunately I am uploading to a file structure that is case sensitive. So I need to add a conversion (strtoupper) so image.jpeg automagically translates to image.JPG. any suggestions?
rubble — 2012-12-11T15:54:53-05:00 — #2
Changing jpeg to JPG is not just capitalisation so strtoupper will not work.
So what you want to do is change the extension in a file upload form?
I can not be bothered to watch the tutorial - what code do you have?
dpiearcy — 2012-12-11T16:45:53-05:00 — #3
You need to strip the extension with something like this:
$strip = explode(".", $fileName); // Split file name into an array using the dot
$fileExt = end($strip); // Now target the last array element to get the file extension
Then use strtoupper like:
$fileExt = strtoupper($fileExt);
In theory this would work though I haven't tried it.