Why am I able to upload files bigger than my post_max_size= ? [Details inside]

About my system

  • Hardware: Rasberry Pi 2 B+
  • OS: Raspbian Jessie 8.0
  • NextCloud: 11.0.2
  • PHP: 5.6.29-0+deb8u1
  • Apache: Apache/2.4.10 (Raspbian)

Background Info

  • I have followed this tutorial to get NextCloud set up.

  • I have moved my data files out of the default location.

  • I have installed fail2ban.

My problem

NextCloud is allowing me to upload large file sizes even though my setting specifies to only allow file sizes of 2M. (See images below).

My Question

  • Why am I able to upload file sizes larger than the specified limit?

  • Is there anyway to make owncloud work to the limit that I set in the config file?

Image above shows Setting of 2M for upload_max_fileaize

Image above shows that I was able to upload a file of 154.4MB to NextCloud

Can you put a test-file in your doc-root with

<?php phpinfo(); ?>

In order to verify that you have changed the right file and that the settings haven’t been overwritten (by .htaccess file). The default .htaccess of Nextcloud sets it to ~512 MB.

Have you found a solution? I have the same problem.
I have set the upload_max_filesize and post_max_size to 1024M in all config files: .user.ini, .htaccess, php.ini.
But I can upload files with 3GB without an error. In the admin settings under server info the upload limit is shown with 1GB.

I am in a same boat. Anyone found a solution for this problem?

Thank you

I think the reason is that nextcloud was changing upload method from HTTP-POST to HTTP-PUT. Both parameters upload_max_filesize and post_max_size have no effect on PUT.

In this context some filesize checking was removed from code (see github).

I use apache LimitRequestBody Directive in vhost-config to limit filesize.

1 Like