5

I have run into a problem of file sizes maxing out on 256MB.

On PHP side I have
upload_max_filesize & post_max_size set to 1GB

I've created a simple PHP script to test upload size and managed to upload 800MB file. So everything points to Craft having some limits.

In Craft CMS config file I have:

'maxUploadFileSize'     => 1073741824

Yet if I try to upload files larger than 256MB I get a modal message saying file size exceeds 256MB.

2 Answers 2

7

When determining the maximum upload file size, Craft first takes the php.ini file upload_max_filesize, post_max_size and memory_limit into account by getting the minimum value and only then applying the Craft maxUploadFileSize config setting.

2
  • Is this still true for Craft 3? Does Craft always read the entire file into memory when uploading?
    – Simon East
    Commented Jan 29, 2019 at 0:02
  • Yes. Just ran into this on a new site. memory_limit was set to 256, and that was the deciding factor in file size upload limit. Commented Jul 22, 2021 at 14:40
3

Apparently, Craft requires memory_limit to also be set to max value, so setting memory_limit in php.ini did solve my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.