Unable to upload large files in my Bookstack instance #2333

Closed
opened 2026-02-05 03:42:26 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @techauthoruk on GitHub (Jul 26, 2021).

Describe the bug
I am trying to upload large files (>100Mb) to my Bookstack instance (direct deploy to a Linux Ubuntu server) , but these fail with two different errors. I have made the following changes to Bookstack / server config:

In Bookstack custom head:

<script>
// Set the file upload limit to 2GB. The value is defined in MB. 
    window.uploadLimit = 2048;
// Set the file upload timeout to 120 seconds. You can change '120' to be the number of seconds you want the timeout to be. 
    window.uploadTimeout = 600 * 1000;
</script>

In Bookstack .env:

ALLOW_CONTENT_SCRIPTS=true

in php.ini

MAX_INPUT_TIME = 600
MEMORY_LIMIT = -1
MAX_EXECUTION_TIME = 600
POST_MAX_SIZE = 2048M
UPLOAD_MAX_FILESIZE = 2048M

in apache2.conf

Timeout = 600

I also uninstalled PHP 8.x and reverted to PHP 7.4.x with no apparent difference to the issue. The server is not using .htaccess files, so nothing to change / edit there.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create a new page in a book
  2. Click on 'Edit'
  3. Scroll down to Attachments'
  4. Select 'Upload File'
  5. Drag a file > 100MB but < 256Mb
  6. Returns an error of 'object:Object'
  7. Drag a file > 256MB
  8. Returns an error of 'The server does not allow uploads of this size...'

Expected behavior
A clear and concise description of what you expected to happen: Uploading files larger than 100Mb should be carried out successfully without errors.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v21.05.3
  • PHP Version: 7.4.21 (also tried with 8.0.4 - this was the original php version)
  • Hosting Method (Nginx/Apache/Docker): Apache 2
  • Linux: Ubuntu 20.04.02 LTS

Additional context
Add any other context about the problem here: I can upload files greater than 1Gb using an FTP client outside of the Bookstack app. Other apps on the server can also upload large files without an issue.

Originally created by @techauthoruk on GitHub (Jul 26, 2021). **Describe the bug** I am trying to upload large files (>100Mb) to my Bookstack instance (direct deploy to a Linux Ubuntu server) , but these fail with two different errors. I have made the following changes to Bookstack / server config: In Bookstack custom head: ```js <script> // Set the file upload limit to 2GB. The value is defined in MB. window.uploadLimit = 2048; // Set the file upload timeout to 120 seconds. You can change '120' to be the number of seconds you want the timeout to be. window.uploadTimeout = 600 * 1000; </script> ``` In Bookstack .env: ```ini ALLOW_CONTENT_SCRIPTS=true ``` in php.ini ```php MAX_INPUT_TIME = 600 MEMORY_LIMIT = -1 MAX_EXECUTION_TIME = 600 POST_MAX_SIZE = 2048M UPLOAD_MAX_FILESIZE = 2048M ``` in apache2.conf ```ini Timeout = 600 ``` I also uninstalled PHP 8.x and reverted to PHP 7.4.x with no apparent difference to the issue. The server is not using .htaccess files, so nothing to change / edit there. **Steps To Reproduce** Steps to reproduce the behavior: 1. Create a new page in a book 2. Click on 'Edit' 3. Scroll down to Attachments' 4. Select 'Upload File' 5. Drag a file > 100MB but < 256Mb 6. Returns an error of 'object:Object' 7. Drag a file > 256MB 8. Returns an error of 'The server does not allow uploads of this size...' **Expected behavior** A clear and concise description of what you expected to happen: Uploading files larger than 100Mb should be carried out successfully without errors. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v21.05.3 - PHP Version: 7.4.21 (also tried with 8.0.4 - this was the original php version) - Hosting Method (Nginx/Apache/Docker): Apache 2 - Linux: Ubuntu 20.04.02 LTS **Additional context** Add any other context about the problem here: I can upload files greater than 1Gb using an FTP client outside of the Bookstack app. Other apps on the server can also upload large files without an issue.
Author
Owner

@userbradley commented on GitHub (Jul 26, 2021):

Just a passing thought, may be an Apache thing?
https://ubiq.co/tech-blog/increase-file-upload-size-apache/

I could be wrong here, but give it a shot and LMK

@userbradley commented on GitHub (Jul 26, 2021): Just a passing thought, may be an Apache thing? https://ubiq.co/tech-blog/increase-file-upload-size-apache/ I could be wrong here, but give it a shot and LMK
Author
Owner

@techauthoruk commented on GitHub (Jul 27, 2021):

Ah...problem solved! My fault, I edited the wrong php.ini file. I did however have to change the MEMORY_LIMIT setting to 2304M, as with it set to -1 Ubuntu kept complaining of low memory.

All working so will close this now.

@techauthoruk commented on GitHub (Jul 27, 2021): Ah...problem solved! My fault, I edited the wrong php.ini file. I did however have to change the MEMORY_LIMIT setting to 2304M, as with it set to -1 Ubuntu kept complaining of low memory. All working so will close this now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2333