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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

File Upload Limit?


Go to End


5 Posts   8644 Views

Avatar
SuperBlues

Community Member, 25 Posts

8 January 2010 at 11:03pm

Hi, I am having problems solving an issue where I am unable to upload files over 2Mb from within the Files/Images in the CMS. I have read the forum and there has been mention of a php.ini file being modified. I have placed a php.ini file in the root of my server but still have this problem. Any help or advice on where to place the php.ini file or indeed what to change within that file would be greatly appreciated.

Thanks

Avatar
OwenW

Community Member, 45 Posts

9 January 2010 at 2:48pm

Hey SuperBlues.

Your problem is indeed related to php.ini.

In php.ini there is a section related to file uploads that will have the following line in it;

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Change the 2M to be something more in line with what you need, then restart apache and you should be good to go.

It is also possible (though i have not tried this yet) to put the following line in to the .htaccess.

php_value upload_max_filesize 20M

Hope that helps.

Cheers
Owen

Avatar
SuperBlues

Community Member, 25 Posts

11 January 2010 at 1:20am

Hi thanks for clarifying but I have made these changes and still have a 2Mb limit it seems. I clarified that the limit had been changed by viewing the info.php page and it is set to 8mb now but still unable to upload anything larger than 2Mb.

I noticed that there is no value in the upload_tmp_dir does this need to be changed? If so what to?

thanks for any help here guys!!!!

Avatar
Sean

Forum Moderator, 922 Posts

11 January 2010 at 9:18am

You also need to increase the value of "post_max_size" in your php.ini file.

Avatar
vwd

Community Member, 166 Posts

22 June 2017 at 12:43am

Hmm... a little weird, but maybe something has changed on the server. Up until now, haven't had the 2mb max file limit error appear when uploading large files.

In this SS3 instance, I already had the following lines in the php.ini, and it obviously didn't have any effect:

upload_max_filesize = 24M
post_max_size = 24M

I had also uploaded a php.ini with those lines above in the /framework directory, and this didn't have any effect either.

I also tried following the instructions on globally overriding the UploadField_Validator variables in config.yml with the following lines, but this also didn't have any effect:

    Upload_Validator: 
      default_max_file_size: 
        '[image]': '1m'
        '[doc]': '5m'
        'jpeg': 2000

In the end, the only thing that worked for me was adding the following lines to the .htaccess:

php_value post_max_size 24M
php_value upload_max_filesize 24M