Unable to upload file

Hi,

I have been runnning into a Post 500 error on using the upload page. I am using https://blueimp.github.io/jQuery-File-Upload/ version which had been working fine. When I enabled Content-Security-Policy it stopped working so I disabled that. Now I run into an internal server error:

{30144:Tue, 22 Feb 2022 15:46:54 GMT} Zenphoto v1.5.9

WARNING: move_uploaded_file(/opt/bitnami/apache/htdocs/portal/albums/Web-test/brody-smith-yosha.jpg): 
failed to open stream: Permission denied in /opt/bitnami/apache/htdocs/portal/zp-core/zp- 
extensions/uploader_jQuery/uploader.php on line 257

move_uploaded_file called from UploadHandler->handle_file_upload (uploader.php [257])

from UploadHandler->post (uploader.php [323])

from uploader.php [354]

{30144:Tue, 22 Feb 2022 15:46:54 GMT}

WARNING: move_uploaded_file(): Unable to move '/opt/bitnami/php/var/run/phpXwUrQC' to 
'/opt/bitnami/apache/htdocs/portal/albums/Web-test/brody-smith-yosha.jpg' in 
/opt/bitnami/apache/htdocs/portal/zp-core/zp-extensions/uploader_jQuery/uploader.php on line 257

move_uploaded_file called from UploadHandler->handle_file_upload (uploader.php [257])

from UploadHandler->post (uploader.php [323])

from uploader.php [354]

{30144:Tue, 22 Feb 2022 15:46:54 GMT}

USER ERROR: Invalid image instantiation: file does not exist in /opt/bitnami/apache/htdocs/portal/zp- 
core/class-image.php on line 143

trigger_error called from Image->__construct (class-image.php [143])

from newImage (class-image.php [46])

from UploadHandler->handle_file_upload (uploader.php [261])

from UploadHandler->post (uploader.php [323])

from uploader.php [354]

Notes:
Line 257 in uploader.php reads:
move_uploaded_file($uploaded_file, $file_path);

Im thinking it's a permission issue?

Zenphoto is installed into a folder called portal. So portal has 755 as permission. The zp-core should also have 755 as permission right?

Tags:

Comments

  • acrylian Administrator, Developer
    edited February 22

    755 should be working (see https://www.zenphoto.org/news/permissions-for-zenphoto-files-and-folders/). That's for sure a permissions issue. Either your albums folder respectively the actual album has wrong permissions. Also it could be an issue with reading from the temp folder PHP uploads files first before actually moving them.

    Enabling the Content-Security-Policy things is a very sensitive and complicated matter that indeed can break things easily.

Sign In or Register to comment.