[solved] File Manager: problems uploading large files

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

[solved] File Manager: problems uploading large files

Post by cnymike »

Is there a limit to file size or something that file manager will upload?

I've been unable to upload a pdf file which is 4MB in size. File Manager would appear to be contacting the site and uploading the file, but the file never appeared in the list. I attempted to upload several times. It is not a permissions problem as I have checked and uploaded other files successfully.

I had to ftp the file and only then was i able to see it in the file Manager list.

Any ideas? Could it just be a time-out issue?
Last edited by cnymike on Sun Feb 17, 2008 11:18 pm, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: File Manager: problems uploading large files

Post by tsw »

there are multiple places which affect upload file maximum size

1) apache has limit on POST size

2) php has limit on upload file size (and memory limit might affect it also)

3) cmsms has setting for it in config.php

and one more which I cant remember right now ;)
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: File Manager: problems uploading large files

Post by cnymike »

Thanks.

Apparently my problem is something other than the config.php limit of 1000000 bytes because I upped it to 50000000 bytes and still couldn't upload the 4MB pdf file. So I just ftp'd it.

Michael
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: File Manager: problems uploading large files

Post by cnymike »

I've just solved this problem and here is a copy of the other thread in which the solution is offered...

It has taken me several months to figure this out but I've finally discoverd what the problem was.

If you are running under phpsuexec or phpcgiwrap, changing the memory values in the .htaccess file are pointless and will result in an error since Apache is no longer involved when running PHP in cgiwrap or phpsuexec. Instead you need to modify a php.ini file. In my situation, I had changed the php.ini to the following value

Code: Select all

upload_max_filesize = 15M           ; 4 MB default limit on file      
And I also had changed the CMSMS config.php file to this...

Code: Select all

#---------------
#Upload Settings
#---------------

#Maxium upload size (in bytes)?
$config['max_upload_size'] = 15000000;
But still, I was getting the fatal error when attempting to upload files any larger than 8MB. But what I discovered just now, is there is yet another value that must be changed in the php.ini file and that is the "post_max_size" value. Once I increased that value to 15MB as well, the fatal error stopped occurring and I was finally able to upload my 12MB file.

This is the additional value that I had to add to my php.ini file

Code: Select all

post_max_size = 15M  
   

In the hope that this may help someone else in the future, here is some additional information from usphp.com
post_max_size  integer

    Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.

    If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.

    When an integer is used, the value is measured in bytes. You may also use shorthand notation as described in this FAQ.

    If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. , and then checking if $_GET['processed'] is set.
The preceding was found at http://www.usphp.com/ini.core.html
Last edited by cnymike on Mon Feb 18, 2008 2:59 am, edited 1 time in total.
User avatar
myshko
Forum Members
Forum Members
Posts: 102
Joined: Wed Feb 07, 2007 2:36 pm

Re: [solved] File Manager: problems uploading large files

Post by myshko »

Cheers mike,

Saved me some time ;)

D
Post Reply

Return to “CMSMS Core”