Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION Add strtolower for file-extension in upload.php

due to my problem with the Imagizer Plugin, that it doesn't recognize files with an extension in uppercase letter, like pic.JPG, I added the following to upload.php, which finally (woohoo) sorted out the problem:

line 52: $extension = strtolower($extension);

Would it be possible or a good idea to add that to future versions of GetSimple, just to prevent similar problems or is it for any extension important to be saved in GS with case-sensitive?

Just asking, cause it really gave me trouble and finding the solution was really searching for a needle in a haystack.
Thank you in advance.
Isn't it possible to include this in the Imagizer Plugin, since (assuming) the problem only applies to that plugin?
Hello datiswous,

thank you for your message.
Unfortunately, I couldn't fix the problem just by changing the code in Imagizer or maybe I just didn't find the right line?

Ok, but you could ask the plugin creator..
(2017-09-04, 04:50:12)datiswous Wrote: Isn't it possible to include this in the Imagizer Plugin, since (assuming) the problem only applies to that plugin?

It's difficult (for me, anyway ...) because there is already a conversion to lowercase by the GS native upload, but it only changes the filename, not the extension. However, the file information exported from the GS upload has the filename (and extension) in the same case as the file that was transferred.

Thus, if I upload a filename such as IMG_1000.JPG (quite common from a camera), the GS upload saves a file named img_1000.JPG, but it reports the filename as 'IMG_1000.JPG'.

This means that there has to be much more manipulation of the reported filename to allow further processing in order to avoid errors ('No such file or directory ...').

It would be much more consistent if GS changed the complete filename, including the extension.
interesting, ill check into it, if we are normalizing filename we should be normalizing extensions also, so i agree
feel free to open an issue on github
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
(2017-09-10, 22:42:45)shawn_a Wrote: ... feel free to open an issue on github

Thanks, Shawn:

In fact, the extension isn't cleaned at all and can contain any of the forbidden characters.  Exclamation

Users browsing this thread: 1 Guest(s)