Uploading multiple files error

I have a content management system built in Wappler for one of my clients that has been running fine for the last 4 months or so, on Friday the user contacted me saying that her slideshow uploads were not working. I asked her to send me the original files which were all .jpg
The total size after adding all 18 .jpg files would be 329mb, which when i test it myself produces an error in Google Chrome of
Error 413 Request Entity Too Large

I have adjusted my .user.ini file to make sure i have far more than that just while testing

memory_limit = "3000M"
upload_max_filesize = "768M"
post_max_size = "1152M"
max_execution_time = 1200
max_input_time = 1200

After adjusting and rebooting both Apache and PHP-FPM 7.2 I tried again and get the same error, it did not even seem like it took any longer to produce the error.

After a Google search I then went and adjusted my .htaccess file to add

LimitRequestBody 0

Again i rebooted both services, and i still get the error.

I have rebooted the entire VPS server just incase, as well as rebooted my own mac and tried on Chrome, just incase it was some remnant cache or something being held.

Anybody got any advice as to what I can try next, im not sure if there is a log file somewhere i can try see when exactly it’s breaking.

Some ideas if you haven’t already tried them Paul,

Maybe your host has a hard limit set on PHP uploads that was recently introduced?

Are you sure you’ve added that to the correct .ini file? Sometimes with Apache there are more than one, you can use phpinfo to find out where it is located

<?php echo phpinfo();?>

It could also be a permissions error. If you check error.log (or similar) it could be that the permissions of the upload directory have changed.

Another thing to try although I doubt will make a difference in your case is changing the file size M to mb.

1 Like

Hello @psweb ,
Please check nginx
It sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field. Here’s an example of increasing the limit to 50MB in /etc/nginx/nginx.conf file.

Set in http block which affects all server blocks (virtual hosts).

http {
    ...
    client_max_body_size 50M;
}

Set in server block, which affects a particular site/app

server {
    ...
    client_max_body_size 50M;
}

Set in location block, which affects a particular directory (uploads) under a site/app.

location /uploads {
    ...
    client_max_body_size 50M;
} 

Save the file and restart Nginx web server to apply the recent changes using following command.

systemctl restart nginx
1 Like

Thanks Max, I did look through my phpinfo() already but not for paths to ini files and rather to check that the .user.ini file i changed had indeed done what it was supposed to do. I will take another look through it tough for paths to see if i can find something more, thanks for answering.

Thanks for giving me some ideas Serhat, unfortunately this particular server is an Apache, PHP, SQL, CentOs7 one, but doing a search on what you suggested in Google did point me to their Apache/PHP counterpart commands, so i will give some of those a try too.