MiczFlor / RPi-Jukebox-RFID

A Raspberry Pi jukebox, playing local music, podcasts, web radio and streams triggered by RFID cards, web app or home automation. All plug and play via USB. GPIO scripts available.
http://phoniebox.de
MIT License
1.38k stars 397 forks source link

fileUpload.php accepts no filesnames with spaces #180

Closed gizmo21 closed 6 years ago

gizmo21 commented 6 years ago

Files via fileUpload.php only work with mp3 filenames without spaces. FIles with Umlauts work but spaces seem to be evil and no error given in frontend and I could also find no specific error in php7 or /lighttpd/error.log - (tested Firefox on Win8 and firefox/chrome Android)

not cruical - just as infos for others, that php config is OK as long as filename without spaces are uploaded, and filename with spaces are accepted on SMB way

simple fix would be to replace spaces by '_' which works but modifies filenames :

  foreach($uFiles['ufile'] as $key => $values) {
            $replafile = str_replace(" ", "_", $values['name']);  // simple replace
            $exec = "mv ".$values['tmp_name']." ".$moveFolder."/".$replafile."; chmod 777 ".$moveFolder."/".$replafile;  //   line with new variable
//  original line:      $exec = "mv ".$values['tmp_name']." ".$moveFolder."/".$values['name']."; chmod 777 ".$moveFolder."/".$values['name'];
            exec($exec);

Another option would be to correctly quote the whole paths i guess, but haven't found anything quickly.

So now I have server configged and running, i'm going to search for a RFID reader and a small set of stickers to attach to tonie-like figurines.

MiczFlor commented 6 years ago

Hi @gizmo21 actually, this was a silly mistake on my side. Fixed it: https://github.com/MiczFlor/RPi-Jukebox-RFID/pull/182 thanks for reporting the bug - and looking forward to seeing your Phoniebox in the thread with the pictures :)

gizmo21 commented 6 years ago

Yes will send some pics, at first it will be in an beta-box as I'm also trying to implement wireless charging with an pass-through-powerbank (=UPS, USV function) which can charge and serve at the same time. Already got some extra function by having the option to attach USB-CDROM and autorip audio with "abcde"-cmdlineripper. Will try to add this to your Webinterface but only exec without status output for the start.