Why does "sudo pcmanfm" break the php function move_uploaded_file()?

82 views Asked by At

I just started a little project on a raspberry pi running Raspberry Pi OS. I have a vanilla apache2 installation where a php script moves a send file (via http POST) to an usb stick. The usb stick is mounted via usbmount and uses for the mounting process a specific user and group which are also used by the webserver. The php script looks like this:
$fname = '/media/usb/' . date('dmYHisv') . $_FILES['userfile']['name']; move_uploaded_file($_FILES['userfile']['tmp_name'],$fname);

This works just fine.... UNTIL I am using "sudo pcmanfm" to view the files on the usbstick in /media/usb.

After executing said command I cannot save any file to the drive. No matter what I try the webserver is not capable of moving the file. It took me way too long to realise this and I am deeply interested if someone can help me out and tell my why this happens.

0

There are 0 answers