[Support Request]: Can't Upload files larger than 2 MB #2647

Closed
opened 2026-02-05 04:42:37 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Flo-Koenig on GitHub (Feb 10, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

If i wanted to Upload a file larger 2 MB i got the following error
"The file could not be uploaded. The server may not accept files of the size."

I have changed the following entries, the error persists.

/etc/php/7.4.cli.php.ini
post_max_size=0
upload_max_filesize = 512M
memory_limit=-1

/var/www/bookstoack/.env
FILE_UPLOAD_SIZE_LIMIT=100

Custom HTML Head Content

<script> window.uploadTimeout = 6666 * 1000; window.uploadLimit = 600; </script>

Exact BookStack Version

21.12.5

Log Content

No response

PHP Version

7.4

Hosting Environment

Ubunut 20.04
Use bookstack installation script on fesh ubunut 20.04

I moddified the virtualhost file to use and redirect to https, attached my virtualhost file.
/etc/apache2/sites-available/bookstack.conf

<VirtualHost *:80>
	ServerName kb.xyz.de
	RewriteEngine On
	RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>


ServerName kb.xyz.de
ServerAdmin admin@xyz.de
DocumentRoot /var/www/bookstack/public/

SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/kb.xyz.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/kb.xyz.de/privkey.pem

    <Directory /var/www/bookstack/public/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        <IfModule mod_rewrite.c>
            <IfModule mod_negotiation.c>
                Options -MultiViews -Indexes
            </IfModule>

            RewriteEngine On

            # Handle Authorization Header
            RewriteCond %{HTTP:Authorization} .
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

            # Redirect Trailing Slashes If Not A Folder...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_URI} (.+)/$
            RewriteRule ^ %1 [L,R=301]

            # Handle Front Controller...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ index.php [L]
        </IfModule>
    </Directory>

<Location "/uploads">
    Options -Indexes
</Location>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
Originally created by @Flo-Koenig on GitHub (Feb 10, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario If i wanted to Upload a file larger 2 MB i got the following error "The file could not be uploaded. The server may not accept files of the size." I have changed the following entries, the error persists. /etc/php/7.4.cli.php.ini post_max_size=0 upload_max_filesize = 512M memory_limit=-1 /var/www/bookstoack/.env FILE_UPLOAD_SIZE_LIMIT=100 Custom HTML Head Content <script> window.uploadTimeout = 6666 * 1000; window.uploadLimit = 600; </script> ### Exact BookStack Version 21.12.5 ### Log Content _No response_ ### PHP Version 7.4 ### Hosting Environment Ubunut 20.04 Use bookstack installation script on fesh ubunut 20.04 I moddified the virtualhost file to use and redirect to https, attached my virtualhost file. /etc/apache2/sites-available/bookstack.conf ```apache <VirtualHost *:80> ServerName kb.xyz.de RewriteEngine On RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] </VirtualHost> <VirtualHost *:443> ServerName kb.xyz.de ServerAdmin admin@xyz.de DocumentRoot /var/www/bookstack/public/ SSLEngine On SSLCertificateFile /etc/letsencrypt/live/kb.xyz.de/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/kb.xyz.de/privkey.pem <Directory /var/www/bookstack/public/> Options Indexes FollowSymLinks AllowOverride None Require all granted <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> </Directory> <Location "/uploads"> Options -Indexes </Location> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> ```
OVERLORD added the 🐕 Support label 2026-02-05 04:42:37 +03:00
Author
Owner

@Flo-Koenig commented on GitHub (Feb 10, 2022):

i found the solution, my mistake

@Flo-Koenig commented on GitHub (Feb 10, 2022): i found the solution, my mistake
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2647