Forums

[resolved] Upload max size - header and media (3 posts)

  1. muscat_gummy
    Member
    Posted 9 months ago #

    My max upload is set to 2M. For an image file for a plugin I wrote myself that is indeed the limit. For the header image, however, it's 1.5M. And for any attachments to posts it's a mere 1M. Is there anything defined in WordPress? I checked my php.ini file and it's indeed set to 2M. If I echo phpinfo() everything says 2M. What could be going on?

  2. muscat_gummy
    Member
    Posted 9 months ago #

    Ok, so I figured out where to change the allowed header image size (via network settings as a superadmin). My media files are still limited to 1M, though. :(

  3. muscat_gummy
    Member
    Posted 9 months ago #

    Finally found the problem! In wp-admin/includes/media.php, the variable $upload_size_unit is set. It converts bytes to megabytes and then converts it to an integer. Well, 2048000 bytes = 1.953125 MB. This value is then converted to an integer... doing so Rounds. It. Down. To. 1MB.

    So heads up to anyone with the same problem!

Reply

You must log in to post.

About this Topic