grav-plugin-admin icon indicating copy to clipboard operation
grav-plugin-admin copied to clipboard

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

Open tihartma opened this issue 4 years ago • 9 comments

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

tihartma avatar Feb 17 '21 16:02 tihartma

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 avatar Feb 17 '21 18:02 rhukster

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

rhukster avatar Feb 17 '21 18:02 rhukster

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.

tihartma avatar Feb 18 '21 08:02 tihartma

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.

mahagr avatar Feb 18 '21 08:02 mahagr

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.

tihartma avatar Feb 18 '21 10:02 tihartma

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

mahagr avatar Feb 18 '21 14:02 mahagr

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

rhukster avatar Feb 18 '21 20:02 rhukster

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 avatar Jul 27 '21 11:07 dearandrewkim

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.

dearandrewkim avatar Jul 27 '21 11:07 dearandrewkim