# Can't upload PDF to S3

**URL:** https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766
**Category:** Support
**Created:** [December 21, 2021, 11:27am UTC](https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766 "2021-12-21T11:27:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [December 21, 2021, 11:27am UTC](https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766/1 "2021-12-21T11:27:57Z")

</div>

Trying to upload PDF’s I have followed all the posts here on how to do it and nothing works - always blocked even if smaller than limit size set. I have added ‘pdf’ to the allowed file suffixes list. Consequently created an AWS Free Tier S3 account and a backet. Nothing uploads to S3, not even images.

I appear to be hopelessly lost. Any pointers as to why using S3 with proper access keys wont work?

Self hosted Docker install.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 21, 2021, 1:53pm UTC](https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766/2 "2021-12-21T13:53:59Z")

</div>

> [@Andro](#):
>
> Nothing uploads to S3, not even images.

So it’s not a PDF issue, but an S3 issue. DId you follow [Using Object Storage for Uploads (S3 & Clones)](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916) or [Setting up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229)?

---

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [December 31, 2021, 7:46am UTC](https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766/3 "2021-12-31T07:46:13Z")

</div>

So I spent the time learning the details of Amazon S3, Cloudfront and so on. I am happy to report it uploads great!

But still totally unable to upload any PDF. I can’t quite see how this could be S3 related given that other files work fine - but I may be wrong.

No matter what size I set for file uploads and no matter what size a PDF is, I can’t upload them. I always get:

> ```
> Sorry, that file is too big (maximum size is 40 MB). Why not upload your large file to a cloud sharing service, then paste the link?
> 
> ```

I followed the instructions for how to increase file upload size but no size PDF will upload, includng sizes well below the limit. I am on the absolutely most update commit set of Discourse.

---

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [December 31, 2021, 9:42am UTC](https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766/4 "2021-12-31T09:42:42Z")

</div>

Finally figured it out at last. I had to add **client\_max\_body\_size** in the nginx reverse proxy server for discourse. In hindsight this is obvious, but it takes time to see sometimes!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 31, 2021, 11:18am UTC](https://meta.discourse.org/t/cant-upload-pdf-to-s3/212766/5 "2021-12-31T11:18:19Z")

</div>

Good catch! So obvious… once you know. Stuff like that is hard to figure out and why standard installations are (mostly) so that’s supported here.
