How to change upload limits and fix upload problems

Here we try to answer typical questions
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

How to change upload limits and fix upload problems

Postby RandolphCarter » Thu Jan 17, 2013 2:42 pm

The first starting point containing infos how to deal with big file uploads is the official documentation available here:

https://doc.owncloud.org/server/8.2/adm ... ation.html

If you can't find the needed infos there continue with this informations:

If you have problems uploading files in general:

If you have problems uploading files over a certain size limit, make sure

The maximum allowed upload size is determined as the minimum of these values:
  • php configuration entry "post_max_size"
  • php configuration entry "upload_max_filesize"
  • The free space left on the target device

Important notes:
  • The post_max_size and upload_max_filesize in your php.ini gets overwritten by the .htaccess file shipped with ownCloud when AllowOverride is set to All. If you're using the default .htaccess file shipped by OC you will see an upload limit of 513MB.
  • If your upload_tmp_dir directive of your php.ini is located on a different partition also make sure that this folder has enough space for uploading large files.

For the php values, you should make sure the values you are setting are actually considered (see "How to check your PHP version and configuration"; when calling the info.php file in the browser, you should see the configuration values from above on the output, with the values as php is using them at the moment. If they don't reflect what you have set, one of the most common problems is that you didn't restart the server after changing them.
Another probably cause on apache servers if you set the values via .htaccess would be that the "AllowOverride" directive in your virtual host is set to "None", and therefore no .htaccess settings are considered; change it to "All".

Setting the maximum upload size in the Webinterface
In most installations, there is a maximum upload size to be configured in the "Admin" section as administrative user called "File handling". This sets the two above php settings in the .htaccess file. If you don't see this option, your .htaccess is not writable, or it isn't effective!
Users running NginX, lighttpd or other webservers not using .htaccess files won't see the gui too.


Note for windows/IIS users: You should take a good look at this tutorial: viewtopic.php?f=8&t=2370 (especially the "Request Filtering" section)

Note for really big files (>2GB): If your upload fails with a message like "Upload exceeds your max_upload_limit", you might consider updating your php to a newer version. For me, this problem occured with files > 2GB with php version 5.3.10, but was solved with version 5.4.13.
Bugreport at the php bugtracker for this issue: https://bugs.php.net/bug.php?id=60205
Last edited by RealRancor on Tue Mar 01, 2016 3:18 pm, edited 2 times in total.
Reason: Fix link to official docs

openworld
Newbie
Posts: 1
Joined: Sat Feb 16, 2013 3:07 pm

Re: How to configure upload limits

Postby openworld » Sat Feb 16, 2013 3:24 pm

I had problems uploading files in general and this post didn't help (It took me a long time to understand it (it links to German...) and it was a dead-end.
In my case, this link gave the solution : viewtopic.php?f=3&t=1878
If you want to know if you are in a similar situation, check this parameter (via info.php containing phpinfo()) : disk_free_space. If it is disabled and you cannot change it (your providers)... then this might be the solution.

The first step was to check some settings because I use a commercial shared hosting : post_max_size, upload_max_filesize, max_file_uploads. The default values of my provider weren't bad, so it was not the problem. It is easy to check if you put an info.php file (with phpinfo() in it).

At first, application said max upload size is 0. I managed to get beyond that without solving the problem and then the application said "no more space left on device"... which I knew was not true. In fact, owncloud uses "disk_free_space" in order to check free space on the disk but many providers block this function. If "disk_free_space" is deactivated, it makes it impossible to use file uploads... So this was the root cause in my case.

The solution is explained in the link mentioned earlier. You have to comment some lines here : ./3rdparty/Sabre/DAV/FS/Directory.php and put a value here : ./lib/filestorage/local.php

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: How to configure upload limits

Postby RealRancor » Wed Feb 20, 2013 10:58 am

RandolphCarter wrote:In most installations, there is a maximum upload size to be configured in the "Admin" section as administrative user. This sets the two above php settings in the .htaccess file. If you don't see this option, your .htaccess is not writable, or it isn't effective!


Additionally NginX users have to set this:

Code: Select all

fastcgi_param htaccessWorking true;


in the

Code: Select all

location ~ \.php$


block and restart NginX. I've just reported a bug at the documentation bugtracker so this will be added to the NginX configuration example.
*gone*

jonhenry
Newbie
Posts: 1
Joined: Tue Feb 26, 2013 6:13 pm
ownCloud version: 4.5.7
Webserver: Apache
Database: MySQL
OS: Unknown

Re: How to configure upload limits

Postby jonhenry » Tue Feb 26, 2013 6:16 pm

openworld wrote:In my case, this link gave the solution : viewtopic.php?f=3&t=1878


Hey open, thanks for the walkthrough, I didn't get the above either so hopefully the link you gave and your instructions will help, ty ty
Henry

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: How to change upload limits and fix upload problems

Postby RealRancor » Wed Apr 03, 2013 4:57 pm

There is also a document about "Common Pitfalls" when uploading files via PHP (what OC is doing) available here:

http://www.php.net/manual/en/features.f ... tfalls.php
*gone*

Budgreg
Beginner
Posts: 12
Joined: Fri Apr 06, 2012 3:09 pm

Re: How to change upload limits and fix upload problems

Postby Budgreg » Thu Apr 18, 2013 11:15 pm

After months of troubleshooting this post solved my sync issues: http://www.joh.fi/blog/2013/01/11/installing-owncloud-on-a-shared-host/

In short:
=> Edit the .htaccess file in your OwnCloud Folder
=> In the <IfModule mod_rewrite.c> section change the following line

Code: Select all

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}

to

Code: Select all

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

(just add ",L" at the end)

=> Add the following lines to the end (after the last section):

Code: Select all

Order allow,deny
Allow from all


br, Gregor

tsukaeru
Newbie
Posts: 2
Joined: Tue Jun 11, 2013 6:14 am
ownCloud version: 5.0.6
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.4.15

Re: How to change upload limits and fix upload problems

Postby tsukaeru » Tue Jun 11, 2013 8:58 am

RandolphCarter wrote:If you have problems uploading files in general:
For me, this problem occured with files > 2GB with php version 5.3.10, but was solved with version 5.4.13.
Bugreport at the php bugtracker for this issue: https://bugs.php.net/bug.php?id=60205


I have 5.4.15, but still see the same problem with anything > 2047M. I am using the x64 remi RPMs. Did you compile PHP yourself?

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: How to change upload limits and fix upload problems

Postby RealRancor » Tue Jun 11, 2013 10:08 am

Hi,

as you can see at the two other linked bug reports above this is still an issue with 32 and 64bit systems. Probably the distro of RandolfCarter has included this custom patches and the RPMs of remi not.
*gone*

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: How to change upload limits and fix upload problems

Postby RandolphCarter » Fri Jul 05, 2013 1:57 pm

I haven't built php myself; I use the 5.4.13 package (5.4.13-2~precise+1, to be exact), from a custom ppa: http://ppa.launchpad.net/ondrej/php5/ubuntu , as recommended e.g. here: http://askubuntu.com/questions/109404/h ... n-ubuntu-1
Probably they've included some patches regarding this.
If I have time I will test whether this is fixed in the official php5.4 package on latest 13.04 version.

axxo1
Newbie
Posts: 1
Joined: Sun Aug 25, 2013 7:57 am

Re: How to change upload limits and fix upload problems

Postby axxo1 » Sun Aug 25, 2013 8:01 am

Do you know if is it possible to set upload_max_filesize in an .htaccess file?

I have been trying it without success, but it might be just me.


  • Similar Topics
    Replies
    Views
    Last post

Return to “FAQ”

Who is online

Users browsing this forum: No registered users and 4 guests