Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Uploadify File Size Limit

Go to End

3 Posts   4052 Views

Scott Farmer

Community Member, 49 Posts

19 April 2013 at 2:58pm


I'm trying to upload files greater than 8M using uploadify module. Using latest stable version of silverstripe 2.4.xx

I've tried adding custom php.ini under the sapphire folder:

upload_max_filesize = 20M

post_max_size = 20M

max_input_time = 120

max_execution_time = 120 

Also tried adding in .htaccess file.

I'm running MAMP and php version 5.2.17. Looking at the php.ini, upload limit is set at 32M.

Turning on uploadify debugging, shows a file size limit of 8000000 bytes.

Interesting to note, when echo this line to the screen: ini_get('upload_max_filesize'), it comes back with 256M

Any help here would be much appreciated.



Community Member, 23 Posts

24 April 2013 at 2:50am

Does Uploadify have a separate max file size setting?

Have you tried changing MAMP's main php.ini to see if that helps?
(also, IIRC, you should be putting your php.ini in root, not in /sapphire)

Scott Farmer

Community Member, 49 Posts

24 April 2013 at 4:14pm

You can can set file size like this:
$UserPhoto->setVar('sizeLimit', '5242880'); (doesn't work)

Otherwise it gets the file size from the php setting for max file upload size. Setting the above and the php variable made no difference. It was always 8mb. Default on the server was 32mb.

I couldn't work where it was getting the 8mb from. I looked at the javascript code (after switching to src version) in uploadify and found where it was setting the size limit, about line 93 and hacked in a number to see if it would work and it did! i.e.
if (settings.sizeLimit) data.sizeLimit = 20971520;

I haven't had a chance to work through, but at some point the variable is not getting set or passed through. I needed a quick solution.

Changing the php.ini and placing in root or sapphire folder had no effect at all.