1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 The uploaded image is too big. The uploaded file is too large.

Discussion in 'Troubleshooting and Problems' started by Movie Prop Sites, Feb 12, 2015.

  1. Getting this error when trying to upload an image file.

    I have seen several similar threads on this topic, but none that have a definitive answer. We are on a dedicated server and have completed control over it.

    We have limited file sizes to 3600X3600 and 3Mb. When I try to upload an image large than that, instead of resizing it, I get this error. The same error appears whether we are using Imagemagick or GD.

    We have removed the max upload size in the php.ini and we aren't seeing any errors in the php log or the website error log... yet we can't upload an image larger than our limits without getting the error when I thought the standard procedure was to resize the image automatically.

    Please help!
  2. Nobita.Kun

    Nobita.Kun Well-Known Member

    In the php.ini config file. You should increase this value to:

    upload_max_filesize 5M
    Then restarting server.
    AndyB likes this.
  3. Mike

    Mike XenForo Developer Staff Member

    How big was the specific image? By default, images are only resized up to 20 megapixels which is 4000x4000; an image larger than that won't be resized due to the amount of memory it requires. You can increase this by setting this value higher in config.php:
    $config['maxImageResizePixelCount'] = 20000000;
    In terms of file size limits, note that we only resize the image based on dimensions. It's possible for the file size to still be too big after resizing. I don't think that's the error here though.
  4. Ah!! This particular image exceeds that! We will add that in that line and try again. Thanks, @Mike!
  5. Mike

    Mike XenForo Developer Staff Member

    Note that the value I provided (20000000) is the default. You can increase it as necessary, but you may need to increase PHP's memory_limit in php.ini (or config.php) or you could run into errors when resizing a large image.
  6. @Mike , that seemed to resolve the issue! Thanks.
  7. StonePilot

    StonePilot Member

    I've found that I can't upload straight from my DSLR camera, and some members with high end mobile devices are getting very large filesize and I assume high megapixel (4000x4000) sizes as well. I can't upload a bunch of files so I'll try this config change, hopefully it will resize them down.
  8. StonePilot

    StonePilot Member

  9. I think a little bit of love for the wording in the admin panel and the user dialog would go a long way to reduce confusion.

    The admin control panel makes it seem like we will reject images over whatever dimensions we specify, instead of resizing them:

    And the user dialog makes it seem like we will reject their images above certain pixel dimensions:


    I got it working and it's a feature of Xenforo I love, but not before investigating the Good for nothing Kraken plugin and other options before discovering that Xenforo really does do image resizing, not just image rejections based on size.
    Last edited: Aug 8, 2015
  10. Brandon Sheley

    Brandon Sheley Well-Known Member

    I don't see this line in the config.php file
    does it need to be added?
  11. Brogan

    Brogan XenForo Moderator Staff Member

    Brandon Sheley likes this.
  12. Ingenious

    Ingenious Well-Known Member

    @Chris MacAskill you can change the phrases max_image_height and max_image_width to help reduce confusion. I changed "Max image width" to "Images above this width will be resized after upload" for example.

Share This Page