Skip to main content
Participant
May 3, 2021
Question

Django AWS S3 pdf Embed Integration

  • May 3, 2021
  • 2 replies
  • 804 views

Hi,
I've successfully integrated pdf Embed API on my local machine, but I want to use S3 as bucket.
It's failing from some reason.

My aws s3 CORS is:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD",
            "POST",
            "PUT"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

 

And I tried once with Adobe Credential on which allowed domain is 'localhost', and once with 'django-02-files.s3.amazonaws.com'.

 

Both didn't work for me..

Any suggestion will be helpful !

Thanks !

 

P.s-

I well aware that currectly all my aws keys are in the JS code, it will be the next thing that i will fix.

(I'm a fresh CS Grad that builds my first project)

This topic has been closed for replies.

2 replies

Legend
May 3, 2021

Just make the AWS file public.

Lior5EBEAuthor
Participant
May 3, 2021

I'm considering it, but there are some strange behaviour.

In the same page I included the user image, which is also in the same s3 bucket (different folder).

You can see the Image, but not the pdf file.

 

I tried to solved it for 4-5 hours, and thought that the problem is in the pdf embed api, but now I'm confused..

 

I will try it.

 

Lior5EBEAuthor
Participant
May 3, 2021

The Error is:

File preview error: File preview not available, please reload to try again.