Closed GiantCrocodile closed 2 years ago
Ok, this must be related to something else than the max. filesize: When I try to upload a PDF of multiple MB, I get a proper error:
Die Datei ist größer als die upload_max_filesize Einstellung in der php.ini
If you look at the network tab of your browser dev tools, can you see a response body of that request to files/upload
that returns HTTP 500
? If the body is empty, please ensure you have debug
mode enabled. Please also check your PHP error log.
@lukasbestle Yes, I see such a response. The response body contains:
{"status":"error","message":"Es wurden keine Dateien hochgeladen","code":500,"exception":"Exception","key":null,"file":"\/kirby\/kirby\/src\/Api\/Api.php","line":761,"details":[],"route":"pages\/([a-zA-Z0-9\\.\\-_%= \\+\\@\\(\\)]+)\/fields\/([a-zA-Z0-9\\.\\-_%= \\+\\@\\(\\)]+)(?:\/(.*))?"}
PHP error log throws:
[25-Jun-2022 16:23:23 UTC] PHP Warning: POST Content-Length of 11922225 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
I'm curious why it works for the PDF file properly but not for this one.
OK, it looks like the file is both larger than the PHP upload_max_filesize
and the post_max_size
(both php.ini
options) while the PDF is only larger than the upload_max_filesize
, but still smaller than the post_max_size
.
If the post_max_size
is exceeded, PHP will pass an empty $_FILES
variable to the script (in this case to our Kirby upload handler). You can read more in the PHP docs: https://www.php.net/manual/en/ini.core.php#ini.post-max-size
To be honest I feel like we cannot do anything about this as PHP already blocks the upload and Kirby won't even know that a file was supposed to be contained in the request.
We plan to implement chunked uploads in an upcoming release, which will enable uploads of large files. With chunked uploads, this issue will no longer occur. We cannot promise yet when this will happen as there are a few conceptual issues we need to solve to get the feature right.
Until then, you can increase your post_max_size
to allow uploads of larger files.
Thank you for your explanation @lukasbestle and nice to hear that chunked uploads are coming.
Description
When you try to upload a file (~ 12 MB, starterkit-main.zip as an example) that is too big, a general error is thrown which doesn't help the enduser to understand the issue.
Expected behavior
The error message mentions reasons for the error or tries to help the user to point him/her to the right direction.
Screenshots
To reproduce
I suspect this is related to the file size. When I try to upload
kirby-3.7.0-rc.2.zip
(~1.7 MB) it does work.Your setup
Kirby Version
3.7.0-rc.2
Console output
Your system (please complete the following information) Windows 11, WAMP setup, Firefox browser
Additional context
Posted as a separate issue as suggested in https://github.com/getkirby/kirby/issues/4416#issuecomment-1166292952.