Maximum Upload Size

Hi all,

I’ve tried to change the max up size in the admin settings to 200Gb (click save too), and also tried it in the /etc/php5/fpm/php.ini, but no successful.

Need some help.

Thanks in advance.

Not sure what fpm is, but I’ve just done this an hour ago with apache2…

  • vim /etc/php*/apache2/php.ini
  • Find upload_max_filesize and change it (along with post_max_size)
  • Save the file
  • Restart apache2
  • Edit admin settings in NC to reflect php.ini

I’m using Nginx, but my php.ini is similar to yours.

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
post_max_size = 200G

; Maximum allowed size for uploaded files.
upload_max_filesize = 200G

And change it in the admin settings too.

However, after the changes are made, the Maximum upload size has returned to 10GB in the admin settings.

You also modified the nginx configuration file?

Configuring nginx

Change client_max_body_size 16G; to client_max_body_size 16400M; (16MiB more than 16 GiB - totaly 16 * 1025MiB). We have to do this to allow uploads up to exactly 16 GiB because some headers are also send with the upload request counting on the client_max_body_size.

Not sure if this matter, but my php is 5.4.
And I don’t understand why the post_max_size is in ‘M’, while the upload_max_filesize is in ‘G’.
So, the upload size in the admin setting is the post_max_size in GB.

I changed my client_max_body_size 205000M; post_max_size = 205000M; upload_max_filesize = 200G.
But it reverse to 10GB in the admin settings.

I changed it in Nginx too.

In which files exactly do these changes need to be made? I searched every file that is connected to php, and made some changes there as shown above, but NextCloud still tells me that the max upload size is 513MB.

Which is, by the way, a very odd size. I would understand 512MB, but why 513MB?

for nextcloud running on nginx please edit the “.user.ini” file:
sudo -u www-data vi /var/www/owncloud/.user.ini
and change the values to your requirements.

upload_max_filesize=2048M post_max_size=2048M memory_limit=512M mbstring.func_overload=0 always_populate_raw_post_data=-1 default_charset='UTF-8' output_buffering=0

Nextcloud comes with its own nextcloud/.htaccess file. Because php-fpm
can’t read PHP settings in .htaccess these settings must be set in the
nextcloud/.user.ini file.

cheers, carsten

1 Like

Even with the NextCloud 9.0.52, the admin control panel still show Max Upload size is 10G.

Check the permissions of your “.user.ini” file (and this file must placed in your web root folder.)

My NextCloud permission is www-data:www-data and the .user.ini is in there.

No, your".user.ini" file permissions… must (temporaly) be writable by owncloud

Also is your user under nginx is running called www-data ?..

What permission is .user.ini suppose to be ?
The entire webroot is www-data:www-data.
I believe so.

to change file size within admin interface of nextcloud do the following if your apache/ngnix user is www-data:

chown www-data:www-data /var/www/nextcloud/.htaccess

then change it from web interface of nextcloud, then:

chown root:www-data /var/www/nextcloud/.htaccess

No, “.htaccess” is NOT used by nginx !

Nginx use “.user.ini”

Oops, you’re right. My bad

So, according to what you said, I should change the value in the admin panel, then chown the .userini to root:www-data ?

I changed the max upload size in .userini yesterday, and I got file integrity error.

this will let your nextcloud modify .user.ini and you will be able to change the file size in the admin panel

chown www-data:www-data /var/www/nextcloud/.user.ini

this will give not let nextcloud modify the file

chown root:www-data /var/www/nextcloud/.user.ini

Okay, I found out what I was doing wrong, but can’t remember specifically which conf it was. Thus far I’ve changed the /etc/php/7.0/apache, fpm and cli ones, .htaccess in nextcloud root and created for some stupid reason, a .user.ini one as well despite it being for NGINX and not apache2).

The issue for me on the uploads was simply a syntactical one with the correct setting being;


not 512MB, not Mb. It was simply M.

I am using 512M as one example. Other’s would be 5012M. I will also try with G and GB etc. No need to actually let the whole file copy either, just simply drop a file in and if it goes, good stuff.

Okay, so some settings appeared to have reverted the next day and I’m back to 8M upload. I left it like that for the week due to work commitments until I can find out where the reset is occurring.

Does anyone have any input here? Maybe package updates to apache2 or php are setting me back?

Is there an option in the SQL datamase that manages file sizes at all? In my minds overly simplistic eye, this would be the place to manage the NC instance’s file sizes anyway rather than the text files, but that’s not the issue here.

Did you succeed to get it working ? here on apache2 and it accepts my new limit in NC settings (19.5G) but when I try to upload a file that is only 1.5G, it goes till the end and then gives a server error and in Apache error log I have that:
mod_fcgid: HTTP request length 1073750016 (so far) exceeds MaxRequestLen (1073741824)
I have added in fcgid module parameters that lists as:
FcgidMaxRequestLen 107374182400
but not much more success :frowning: NC tells me my limit is at 19.5G for upload but Web server refuses already at 1.5G file upload :frowning: