-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bookstack cannot handle 'large' files #5533
Comments
Hi @kobaz, The status code indicates the request validation is failing (which just checks the page id is valid, and the file upload is a file within the set size limit). Can you confirm the full exact output of running |
|
Okay, what's the output of running the below from your BookStack install directory?: php artisan tinker --execute="dd(config('app.upload_limit'))" |
|
Strange... isn't it? |
Hi @kobaz, I created a 4GB random file, then tested uploading, tweaking any config one property at a time to test the resulting behaviour. Overall, I ended up with a scenario which allows upload/download of these files, and I set the following php.ini values along the way: upload_max_filesize = 5G
post_max_size = 5G
memory_limit = 512M During testing, I found that 422 status could be sent if BookStack could not read the upload as a file, which occured when the file exceeded the set My guess is that in your scenario the php.ini values are not being applied as expected. To check the exact echo "<?php phpinfo();" > public/info.php Then go to If you are running php via an FPM process (and are editing fpm specific config files) you will need to restart the php-fpm process for changes to take effect. |
Describe the Bug
Update related settings to allow large files in apache, php, bookstack
Upload large file
Upload fails
Steps to Reproduce
FILE_UPLOAD_SIZE_LIMIT=4096
LimitRequestBody 4294967296
memory_limit = 4096M
post_max_size = 4096M
upload_max_filesize = 4096M
phpinfo() validates the above settings are loaded.
Upload large file (This one is Content-Length 975151309)
Observe error:
attachments/upload?uploaded_to=377
422 (Unprocessable Content)
I'm seeing that files that go over the apache max request size will result in
attachments/upload?uploaded_to=377
net::ERR_CONNECTION_RESET 413 (Request Entity Too Large)
But If you're within the apache max request size, then you get the 422 error. Is bookstack throwing this? It's hard to tell, since bookstack doesn't seem to write any log files.
Expected Behaviour
Expected upload to be successful.
Screenshots or Additional Context
No response
Browser Details
No response
Exact BookStack Version
v25.02
Updates Since Originally posting the bug:
I made a quick test.php that accepted any type of upload.
I uploaded the exact same file with 'Content-Length 975151309' and the test upload returned 200 OK
It does seem to point to bookstack doing the rejection of: 422 (Unprocessable Content)
The text was updated successfully, but these errors were encountered: