# Wrong maximum size when uploading files

**URL:** https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038
**Category:** Bug
**Created:** [April 5, 2016, 1:58am UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038 "2016-04-05T01:58:20Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![martinduparc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martinduparc/32/115526_2.png) [@martinduparc](https://meta.discourse.org/u/martinduparc)
#### Post date: [April 5, 2016, 1:58am UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/1 "2016-04-05T01:58:20Z")

</div>

The current maximum size I have set up is 200MB. Uploading a file that is less than 200MB works fine but anything above fails, as expected. The issue I have is that the user is then presented with the following message:

> Sorry, the file you are trying to upload is too big (maximum size is **10240kb** )

Nginx is properly configured at _200m_ and the `max image size kb` and `max attachment size kb` are both set to `200000`

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [April 5, 2016, 2:07am UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/2 "2016-04-05T02:07:51Z")

</div>

Could the issue be related to this commit which was fixing the error message?  
[https://github.com/discourse/discourse/pull/3425](https://github.com/discourse/discourse/pull/3425)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 5, 2016, 2:56am UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/3 "2016-04-05T02:56:32Z")

</div>

Did you restart Discourse after changing that setting? It might be required.

---

<div class="post-metadata">

### Author: ![martinduparc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martinduparc/32/115526_2.png) [@martinduparc](https://meta.discourse.org/u/martinduparc)
#### Post date: [April 5, 2016, 11:39am UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/4 "2016-04-05T11:39:05Z")

</div>

I did a full app rebuild after changing the size. Again, file upload works properly, it’s just the error message that still display 10MB. I have entered the container and the internal nginx cont file is right at 200m

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 5, 2016, 8:50pm UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/5 "2016-04-05T20:50:27Z")

</div>

Hmm sure @techapj can you follow up and see? Do we hard code this value in text?

---

<div class="post-metadata">

### Author: ![martinduparc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martinduparc/32/115526_2.png) [@martinduparc](https://meta.discourse.org/u/martinduparc)
#### Post date: [April 6, 2016, 3:02pm UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/6 "2016-04-06T15:02:19Z")

</div>

It doesn’t look like it is hardcoded, at least not in the [localization file](https://github.com/discourse/discourse/blob/8f4bc2228fd5def7a4190222b0ae993a384791d9/config/locales/client.en.yml#L1516).

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 6, 2016, 4:26pm UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/7 "2016-04-06T16:26:56Z")

</div>

> [@codinghorror](#):
>
> Do we hard code this value in text?

We do actually. My bad. Will fix.

(cc @techAPJ)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 6, 2016, 8:51pm UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/8 "2016-04-06T20:51:50Z")

</div>

Thanks @martinduparc for reporting this issue. Fix pushed 🍏

[https://github.com/discourse/discourse/commit/a5d8dfb07e5362f688344f576160066fd0bfaceb](https://github.com/discourse/discourse/commit/a5d8dfb07e5362f688344f576160066fd0bfaceb)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 6, 2016, 10:52pm UTC](https://meta.discourse.org/t/wrong-maximum-size-when-uploading-files/42038/9 "2016-04-06T22:52:25Z")

</div>

This topic was automatically closed after 2 hours. New replies are no longer allowed.
