getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

Unable to upload files (.pdf) to page media form Windows browsers #2072

Open tihartma opened 3 years ago

tihartma commented 3 years ago

In Grav 1.7.5 with Admin Panel v1.10.3 and Form v4.3.1 the pdf file (images work fine) upload gets stuck on windows Browsers (Chrome, Firefox and Edge).

There are no javascript error logs in the console. On Mac OS X everything is working as expected.

image
rhukster commented 3 years ago

are you sure the file is not uploaded correctly by checking the filesystem? This looks like its just trying to render the PDF which it can't because its a PDF file. It should show a PDF thumbnail, but maybe that's the only issue?

rhukster commented 3 years ago

Actually after re-reading, i guess your screenshot is from mac, where it works. It is most likely something related to your webserver on windows. Have you tried with the built-in webserver of Grav? Check this out: https://getgrav.org/blog/using-builtin-webserver

tihartma commented 3 years ago

Thank you very much for your quick response!

The screenshot is taken from Windows Firefox. After picken the file from the local directory this representation appears, but neither the loading bar or the checkmark do. The file can not be found in the filesystem on the server and after saving the page and reloading it, the file representation is gone.

This happen on a FreeBSD, Apache, PHP Version 7.3.26.

This false behaviour is not shown with other separate older installations of Grav (e.g v1.6.31, 16.27) on the same server.

I'm happy to provide more information if needed.

Thank you for the hint to built-in webserver, I have missed this. Unfortunately I don't have the permission to run it on the production server.

mahagr commented 3 years ago

What happens if you go to Flex Objects plugin and disable Pages from it? It should restore the old behavior (though it's just there for backup and not recommended to be used).

Also look into the requests and responses for the file uploads, are there any differences between Win and OSX?

PS: there was a fix for missing files in the latest release, please update it before trying.

tihartma commented 3 years ago

Thank you for your input. I followed your instructions and in the end I was able to narrow the problem down to:

In user/config/plugins/admin.yaml I had set pagemedia.res_max_width to an integer not to 0. By setting it back to 0 the false behaviour is gone.

I don't know if this is a bug or I'm not understanding the pagemedia.res_max_width feature correctly.

mahagr commented 3 years ago

@rhukster I'm not aware of the setting, what it is for, and is this expected?

rhukster commented 3 years ago

it's for resizing on upload of images, it should not be used for PDFs though.

dearandrewkim commented 3 years ago

Hi all, I also experienced the same problem today. It works locally but on the web server, it didn't work. After I put 0 as the max width in the admin plugin setting, I was able to upload pdf.

dearandrewkim commented 3 years ago

And also when I put it max width at some figure and tried uploading pdf again, it experienced error. So I definitely think there is some conflict there.