Piwigo / Piwigo-Android

Piwigo Native Android App
GNU General Public License v3.0
140 stars 43 forks source link

[Play] Failed to move uploaded file #217

Closed valmar closed 4 years ago

valmar commented 4 years ago

Describe the bug and how to reproduce Uploading photos to an album fails. I get the error "Upload failed. An error occurred while upload your photo(s). Please try again (Failed to move uploaded file.)

Expected behavior The photo is uplodaded

What did you do already

Smartphone (please complete the following information):

Additional context Server is a docker container. linuxserver.io, version: arm32v7-2.10.1-ls46 (Standard install) Client is version 1.0.2 (Play store)

ramack commented 4 years ago

@valmar thanks for the report. We have heard about this before, but so far failed to track it down to the root cause as we cannot reproduce it. What is known today is, that the message "Failed to move uploaded file." with the error code 103 is generated by the piwigo server. Potentially there due to a transmission problem, due to permissions on the file system or maybe because temporary files have been deleted.

@plegall do you see a chance to extend the piwigo core and in case of $_FILES["file"]["error"] is set in pwg.images.php also output the error number in there and a different error when is_uploaded_file returns false.

This problem here might also be related to #175...

valmar commented 4 years ago

@ramack Thanks for the quick answer. I found the problem. You put me on the right track. The linuxserver.io docker container sets the max_upload size very very low (2M). If I set it to 10M, the upload works (the image size is 6.06MB).

For future reference, the php.ini file is in the container, but not in a volume, so it is not persisted across restarts of the container itself. The right place to set the value is in php-local.ini, which can be found in /config/php/php-local.ini

I just added the following line to the file (I used 1GB as I have enough memory):

upload_max_filesize = 1024M

Currently, the most popular piwigo docker container seems to be the one from linuxserver. So the people that are reporting the error are maybe all using this docker container.

I will now open an issue with the linuxserver.io developers

Thanks again! This can be closed, on my side

ramack commented 4 years ago

increasing upload_max_filesize on the server side is only a workaround. The real fix is in the app to support chunked file upload. See #126.

But anyhow, this will also be fixed in the next release. So I close this one here also.