<p><strong>Craft</strong> itself, limits the filesize only in the <a href="http://buildwithcraft.com/docs/config-settings#maxUploadFileSize"><code>maxUploadFileSize</code></a>. Default: 16MB</p>

<p>However Craft gets limited by:</p>

<p><strong>PHP:</strong> Has a few values which might cause the problem:</p>

<ul>
<li><a href="http://www.php.net/manual/de/ini.core.php#ini.memory-limit">memory_limit</a></li>
<li><a href="http://www.php.net/manual/en/info.configuration.php#ini.max-input-time">max_input_time</a></li>
<li><a href="http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize">upload_max_filesize</a></li>
<li><a href="http://www.php.net/manual/en/ini.core.php#ini.post-max-size">post_max_size</a></li>
</ul>

<p><strong>AmazonS3:</strong> If not limited by a <a href="http://aws.amazon.com/articles/1434"><code>policy</code> value</a>, the default is 5GB.</p>

<p><strong>User:</strong> Sometimes it can be just a Browser issue causing the problem.</p>

CC BY-SA 3.0
2014-12-03T14:36:29.390Z
So if you upload a file go S3... PHP MaxUploadFileSize, Memory Limit, Max_Input_Time and Post_max_Size dont count? You can upload up to 5GB?
Johannes Lamers
CC BY-SA 4.0
2019-10-28T12:17:04.407Z
@JohannesLamers, I'm curious to that as well. Did you find the answer to your question?
Forza
CC BY-SA 3.0
2014-06-25T21:59:57.283Z
2014-06-25T21:59:57.283Z
Victor
<p>It's almost always an environmental limitation.  The most common culprits are:</p>
<ol>
<li><p>PHP's memory_limit setting: <a href="https://www.php.net/manual/en/ini.core.php#ini.memory-limit" rel="nofollow noreferrer">https://www.php.net/manual/en/ini.core.php#ini.memory-limit</a></p>
</li>
<li><p>PHP's post_max_size: <a href="https://www.php.net/manual/en/ini.core.php#ini.post-max-size" rel="nofollow noreferrer">https://www.php.net/manual/en/ini.core.php#ini.post-max-size</a></p>
</li>
<li><p>PHP's upload_max_filesize <a href="https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize" rel="nofollow noreferrer">https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize</a></p>
</li>
</ol>
<p>These default values vary per host/installation, but try increasing them in your php.ini file. You may or may not need to restart your web server in order for the new settings to take affect.</p>
<p>For your specific case, if those aren't the culprit, then I'd check either S3's upload limitation settings or Craft's own <a href="http://buildwithcraft.com/docs/config-settings#maxUploadFileSize" rel="nofollow noreferrer">maxUploadFileSize</a> config setting, which we default to 16MB.</p>

CC BY-SA 3.0
2014-06-25T21:59:42.813Z
2014-06-25T21:59:42.813Z
2023-11-17T20:42:18.383Z
Brad Bell
<p>Keep in mind that f you're running a <a href="http://buildwithcraft.com/docs/multi-environment-configs" rel="nofollow">multi-environment config</a>, and have configured your local environment (i.e. craft.dev) to point to a remote database, you'll need to make any php.ini changes on your local machine.</p>

<p>You can find the location of your php.ini file with <code>php --ini</code>.</p>

CC BY-SA 3.0
2015-06-30T18:49:58.980Z
2015-06-30T18:49:58.980Z
npedrini
<p>For anyone else interested my issue was not the PHP limit but a limitation of NGINX, there is a setting which needs increased from the default value to allow uploading of larger files, client_max_body_size.</p>

CC BY-SA 3.0
2014-10-24T17:40:37.100Z
2014-10-24T17:40:37.100Z
Daryl Campbell
<p>I had the same issue but I had to update the settings in Plesk, as rules being set elsewhere were being ignored. Someone may have a similar set up to me, and this will save them a few minutes of head-bashing.</p>

CC BY-SA 3.0
2016-11-22T16:25:03.630Z
2016-11-22T16:25:03.630Z
Laura Montgomery
<p>It's most likely PHP. Most PHP installations come standard with a 2M limit.</p>

<p>Check out this <a href="https://stackoverflow.com/questions/3263480/upload-max-size-in-php">Stack Overflow thread</a> for more information on what needs to be adjusted.</p>

CC BY-SA 3.0
2014-06-25T22:05:39.353Z
It was indeed PHP.  Does Craft's "maxUploadFileSize" work on top of PHP's?
a-am
CC BY-SA 3.0
2014-06-25T22:28:50.343Z
Yes, it appears so. Per Brad's answer: _"... Craft's own [maxUploadFileSize](http://buildwithcraft.com/docs/config-settings#maxUploadFileSize) config setting, which we default to 16MB."_
Lindsey D
CC BY-SA 3.0
2014-06-25T21:55:06.153Z
2014-10-21T19:17:17.887Z
2017-05-23T12:38:53.957Z
Lindsey D
<p>When I upload an asset I get an alert window stating my file size is to large. I have increased the file size in the general.php config file larger than the file size, however I keep getting a error. We are using AmazonS3. Is Craft limiting the file size, PHP or AmazonS3?</p>

<assets><config>
When uploading assets what determines the maximum file size?
# When uploading assets what determines the maximum file size?

(Asked by: username_0 on 2014-06-25)

When I upload an asset I get an alert window stating my file size is to large. I have increased the file size in the general.php config file larger than the file size, however I keep getting a error. We are using AmazonS3. Is Craft limiting the file size, PHP or AmazonS3?

**Tags:** assets, config

---

## 6 answers

### Answer by username_8 on 2014-06-25. Score: 8 | Accepted answer

It's most likely PHP. Most PHP installations come standard with a 2M limit.

Check out this [Stack Overflow thread](https://stackoverflow.com/questions/3263480/upload-max-size-in-php) for more information on what needs to be adjusted.

> **Comments:**
> **username_0**: It was indeed PHP.  Does Craft's "maxUploadFileSize" work on top of PHP's?  
> **username_8**: Yes, it appears so. Per Brad's answer: _"... Craft's own [maxUploadFileSize](http://buildwithcraft.com/docs/config-settings#maxUploadFileSize) config setting, which we default to 16MB."_  

---

### Answer by username_1 on 2014-06-25. Score: 14

**Craft** itself, limits the filesize only in the [`maxUploadFileSize`](http://buildwithcraft.com/docs/config-settings#maxUploadFileSize). Default: 16MB

However Craft gets limited by:

**PHP:** Has a few values which might cause the problem:

* [memory\_limit](http://www.php.net/manual/de/ini.core.php#ini.memory-limit)
* [max\_input\_time](http://www.php.net/manual/en/info.configuration.php#ini.max-input-time)
* [upload\_max\_filesize](http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize)
* [post\_max\_size](http://www.php.net/manual/en/ini.core.php#ini.post-max-size)

**AmazonS3:** If not limited by a [`policy` value](http://aws.amazon.com/articles/1434), the default is 5GB.

**User:** Sometimes it can be just a Browser issue causing the problem.

> **Comments:**
> **username_2**: So if you upload a file go S3... PHP MaxUploadFileSize, Memory Limit, Max_Input_Time and Post_max_Size dont count? You can upload up to 5GB?  
> **username_3**: @JohannesLamers, I'm curious to that as well. Did you find the answer to your question?  

---

### Answer by username_4 on 2014-06-25. Score: 11

It's almost always an environmental limitation. The most common culprits are:

1. PHP's memory\_limit setting: <https://www.php.net/manual/en/ini.core.php#ini.memory-limit>
2. PHP's post\_max\_size: <https://www.php.net/manual/en/ini.core.php#ini.post-max-size>
3. PHP's upload\_max\_filesize <https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize>

These default values vary per host/installation, but try increasing them in your php.ini file. You may or may not need to restart your web server in order for the new settings to take affect.

For your specific case, if those aren't the culprit, then I'd check either S3's upload limitation settings or Craft's own [maxUploadFileSize](http://buildwithcraft.com/docs/config-settings#maxUploadFileSize) config setting, which we default to 16MB.


---

### Answer by username_5 on 2015-06-30. Score: 3

Keep in mind that f you're running a [multi-environment config](http://buildwithcraft.com/docs/multi-environment-configs), and have configured your local environment (i.e. craft.dev) to point to a remote database, you'll need to make any php.ini changes on your local machine.

You can find the location of your php.ini file with `php --ini`.


---

### Answer by username_6 on 2014-10-24. Score: 3

For anyone else interested my issue was not the PHP limit but a limitation of NGINX, there is a setting which needs increased from the default value to allow uploading of larger files, client\_max\_body\_size.


---

### Answer by username_7 on 2016-11-22. Score: 2

I had the same issue but I had to update the settings in Plesk, as rules being set elsewhere were being ignored. Someone may have a similar set up to me, and this will save them a few minutes of head-bashing.


---

