Author Topic: [1.7.8] Can't upload images with capital letters in extension(.JPG, .Png, etc)  (Read 15693 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
In 4images v1.7.8 new feature was introduced, that filters filenames, making them lower case. This was done so transfer 4images from case sensitive type servers (UNIX/Linux/Mac) to Windows would be with no problems.

The fix is the following:
in includes/upload.php find:
      $this->name $regs[1];
      
preg_match("/(.+)\.(.+)/"$this->HTTP_POST_FILES[$this->field_name]['name'], $regs);
      
$this->extension $regs[2];


Replace it with:
      $this->name filterFileName($regs[1]);
      
preg_match("/(.+)\.(.+)/"$this->HTTP_POST_FILES[$this->field_name]['name'], $regs);
      
$this->extension strtolower($regs[2]);



Find:
      $this->file_name $this->HTTP_POST_FILES[$this->field_name]['name'];
      
$this->file_name str_replace(" ""_"$this->file_name);
      
$this->file_name str_replace("%20""_"$this->file_name);
      
$this->file_name preg_replace("/[^-\._a-zA-Z0-9]/"""$this->file_name);


Replace it with:
      $this->file_name filterFileName($this->HTTP_POST_FILES[$this->field_name]['name']);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline hape2000

  • Pre-Newbie
  • Posts: 8
    • View Profile
Hallo @4images Guru,

ich bin auf einem Linux Server aber leider konnte ich durch diese Änderung  dieses Problem bis jetzt nicht in den Griff bekommen, im Gegenteil danach konnten  auch keine .jpg Dateien in Kleinschrift mehr hochgeladen werden, es kam immer beim Upload ein weisser Bildschirm mit der Adresse /4images/members.php
Mal warten vlt. kommt doch noch eine Lösung in absehbarer Zeit.

M.f. G.
Hape2000

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
White page = something else. Check server's error logs for more information.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline hape2000

  • Pre-Newbie
  • Posts: 8
    • View Profile
Es gibt keine Servermeldungen auch in der Verwaltungsoberfläche  des Webspace sind keine dokumentiert. Der Fehler ist ja auch wieder weg wenn ich die Orginal upload.php wieder einspiele nur dann
kommt bei Grosschrift .JPG die Meldung von 4images " ungültiges Dateiformat" .Leider liefern viele Kameras ihre Bildateien mit .JPG Endung man müsste also vor dem Upload alle umbennen
Ich muss vlt. dazu noch sagen, dass ich nochmal eine Domain auf dem selben Webspace habe bei dem das 1.7.7 installiert ist welches ohne Probleme läuft, hier können Registrierte auch Bilder bis über 4MB hochladen,
was ich beim 1.7.8 nur im Admin Bereich per Direktupload machen kann.