Support » Fixing WordPress » Error saving media attachment when file size is over 2MB

  • Hello all,

    I know the topic of increasing the maximum upload file size to greater than 2MB has been done to death. Believe me I have read all the posts on this topic and tried all of the suggested solutions. However I am still having problems with this.

    I have tried many methods of increasing the file size including htaccess, the functions file and php.ini. Although the php.ini file is working correctly on the server in the wordpress media library is still says “Maximum upload file size: 2MB”.

    This is not the server limiting it as you can see at the values are in fact 64MB.

    Why then does wordpress still say 2MB in the admin panel media manager and why does it fail with the error “Error saving media attachment” when I attempt to upload a file greater than 2MB?



Viewing 12 replies - 1 through 12 (of 12 total)
  • If you are using WP Multisite, there is a Network Admin setting that will override all of the others. Go to Network Admin->Settings and change the ‘Max upload file size’.

    Thanks for the response, however this is just a single site not a multi-site installation.

    Any other suggestions?

    Look for a theme option that sets the size. If you don’t find that, it may be hard-coded in your functions.php file. Look for an add_filter for upload_size_limit:

    add_filter('upload_size_limit', ...);

    Open the wp_config.php file and append :

    define(‘WP_MEMORY_LIMIT’ , ’64M’);

    The file is in the root directory of your WordPress installation .

    Sorry, define(‘WP_MEMORY_LIMIT’ , ’64M’); didn’t work for me. Arrrg!

    @vtxyzzy – Thanks for the WP Multisite fix! That’s been stumping me for days but now it’s fixed.


    You are all kinds of awesome. I’ve spent 2 days searching for that answer. 2 wasted days and that exactly did the trick in 2 seconds.

    If you were here in town, I’d buy you a beer. Heck, I’d buy you a sixer!

    My multisite threw up when I tried to upload a bunch of photo’s and nothing I could see would fix it. Increased my maximum size from 10MB to 1000MB and everything became happy happy.

    This answer really should be more easily accessible.

    Thank you again!

    I started this topic 10 months ago and never found a solution then. I do not have a multi-site installation so the suggested fix above is not applicable for me.

    I now have another site on a completely different host for which I have the same problem. The host I now have is only limiting the file uploads to 7M however wordpress is still limiting them to 2MB. Now I would like 20MB but I would settle for the 7MB. 2MB is simply not large enough even for photos. My clients cannot resize the pics themselves and the photos from their phones are larger than 2MB!

    Surely someone has figured this out. I have read all the posts on this and tried all the suggestions and NOTHING WORKS! It’s such a common problem, why isn’t there just a setting in wordpress?

    Surely it’s not that difficult, please can someone provide a fix which is guaranteed to work asap? These things shouldn’t take over 10 months to sort out…

    Ok I have now solved this on Dreamhost. If anyone else is on Dreamhost I have used this
    to create an editable php.ini file and the changes I make in it actually affect the site. Which is rather a pleasant change 🙂

    thank you very much for the multisite-tip! although it did not solve my problem completely, it had some effect. now it’s not telling me anymore that i had a limit of 1MB, but of 2MB. so i feel more familiar now with other people having the same problem 😉 and i missed this information. now i’ll try with the php.ini … 🙂

    A simple example in .htaccess file

    <IfModule mod_php5.c>
    php_value post_max_size           10M
    php_value upload_max_filesize     40M
    php_value memory_limit            500M
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Error saving media attachment when file size is over 2MB’ is closed to new replies.