# Maximum Upload Size

**URL:** <https://help.nextcloud.com/t/maximum-upload-size/665>\
**Category:** ℹ️ Support\
**Created:** [June 15, 2016, 10:24pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665 "2016-06-15T22:24:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [June 15, 2016, 10:24pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/1 "2016-06-15T22:24:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [June 15, 2016, 10:45pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/2 "2016-06-15T22:45:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [June 15, 2016, 11:29pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/3 "2016-06-15T23:29:11Z")

</div>

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.  
; [http://php.net/post-max-size](http://php.net/post-max-size)  
post\_max\_size = 200G

; Maximum allowed size for uploaded files.  
; [http://php.net/upload-max-filesize](http://php.net/upload-max-filesize)  
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.

---

<div class="post-metadata">

**Author:** ![slork](https://help.nextcloud.com/user_avatar/help.nextcloud.com/slork/32/204_2.png) [@slork](https://help.nextcloud.com/u/slork)\
**Post date:** [June 16, 2016, 6:34am UTC](https://help.nextcloud.com/t/maximum-upload-size/665/4 "2016-06-16T06:34:04Z")

</div>

You also modified the nginx configuration file?

> **[GitHub - owncloud-archive/documentation: :blue\_book: The ownCloud...](https://github.com/owncloud-archive/documentation)**
>
> :blue\_book: The ownCloud documentation and manual. Contribute to owncloud-archive/documentation development by creating an account on GitHub.

> 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.

---

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [June 16, 2016, 12:09pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/5 "2016-06-16T12:09:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![weka](https://help.nextcloud.com/letter_avatar/weka/32/6_22734026db12803ebb3e059622ac3534.png) [@weka](https://help.nextcloud.com/u/weka)\
**Post date:** [June 17, 2016, 5:55am UTC](https://help.nextcloud.com/t/maximum-upload-size/665/6 "2016-06-17T05:55:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![riegerCLOUD](https://help.nextcloud.com/user_avatar/help.nextcloud.com/riegercloud/32/53593_2.png) [@riegerCLOUD](https://help.nextcloud.com/u/riegerCLOUD)\
**Post date:** [June 30, 2016, 12:34pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/7 "2016-06-30T12:34:50Z")

</div>

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.  
e.g.

`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`

> Note  
> 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.  
> [https://docs.nextcloud.org/server/9/admin\_manual/configuration\_files/big\_file\_upload\_configuration.html](https://docs.nextcloud.org/server/9/admin_manual/configuration_files/big_file_upload_configuration.html)

cheers, carsten

---

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [July 7, 2016, 12:37pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/8 "2016-07-07T12:37:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Akhenaton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/akhenaton/32/158_2.png) [@Akhenaton](https://help.nextcloud.com/u/Akhenaton)\
**Post date:** [July 7, 2016, 3:46pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/9 "2016-07-07T15:46:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [July 7, 2016, 3:53pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/10 "2016-07-07T15:53:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Akhenaton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/akhenaton/32/158_2.png) [@Akhenaton](https://help.nextcloud.com/u/Akhenaton)\
**Post date:** [July 7, 2016, 4:28pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/11 "2016-07-07T16:28:34Z")

</div>

> [@tx7](#):
>
> My NextCloud permission

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

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

---

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [July 7, 2016, 4:30pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/12 "2016-07-07T16:30:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![depawlur](https://help.nextcloud.com/user_avatar/help.nextcloud.com/depawlur/32/564_2.png) [@depawlur](https://help.nextcloud.com/u/depawlur)\
**Post date:** [July 8, 2016, 5:54pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/13 "2016-07-08T17:54:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Akhenaton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/akhenaton/32/158_2.png) [@Akhenaton](https://help.nextcloud.com/u/Akhenaton)\
**Post date:** [July 8, 2016, 6:26pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/14 "2016-07-08T18:26:38Z")

</div>

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

**Nginx use “.user.ini”**

---

<div class="post-metadata">

**Author:** ![depawlur](https://help.nextcloud.com/user_avatar/help.nextcloud.com/depawlur/32/564_2.png) [@depawlur](https://help.nextcloud.com/u/depawlur)\
**Post date:** [July 8, 2016, 6:45pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/15 "2016-07-08T18:45:39Z")

</div>

Oops, you’re right. My bad

---

<div class="post-metadata">

**Author:** ![tx7](https://help.nextcloud.com/letter_avatar/tx7/32/6_22734026db12803ebb3e059622ac3534.png) [@tx7](https://help.nextcloud.com/u/tx7)\
**Post date:** [July 8, 2016, 7:01pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/16 "2016-07-08T19:01:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![depawlur](https://help.nextcloud.com/user_avatar/help.nextcloud.com/depawlur/32/564_2.png) [@depawlur](https://help.nextcloud.com/u/depawlur)\
**Post date:** [July 8, 2016, 8:58pm UTC](https://help.nextcloud.com/t/maximum-upload-size/665/17 "2016-07-08T20:58:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stiiixy](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stiiixy/32/1654_2.png) [@stiiixy](https://help.nextcloud.com/u/stiiixy)\
**Post date:** [November 21, 2016, 5:37am UTC](https://help.nextcloud.com/t/maximum-upload-size/665/18 "2016-11-21T05:37:05Z")

</div>

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;

512M

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.

---

<div class="post-metadata">

**Author:** ![stiiixy](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stiiixy/32/1654_2.png) [@stiiixy](https://help.nextcloud.com/u/stiiixy)\
**Post date:** [November 28, 2016, 9:51am UTC](https://help.nextcloud.com/t/maximum-upload-size/665/19 "2016-11-28T09:51:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vincen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vincen/32/3952_2.png) [@vincen](https://help.nextcloud.com/u/vincen)\
**Post date:** [May 9, 2017, 8:05am UTC](https://help.nextcloud.com/t/maximum-upload-size/665/20 "2017-05-09T08:05:49Z")

</div>

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 ☹ NC tells me my limit is at 19.5G for upload but Web server refuses already at 1.5G file upload ☹

[Next page](https://help.nextcloud.com/t/maximum-upload-size/665.md?page=2)
