Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Django AWS S3 pdf Embed Integration

Community Beginner ,
May 03, 2021 May 03, 2021

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)

TOPICS
How to , PDF Embed API
704
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 03, 2021 May 03, 2021

The Error is:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 03, 2021 May 03, 2021

Just make the AWS file public.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 03, 2021 May 03, 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.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 05, 2021 May 05, 2021
LATEST

I changed the bucket to public - Still not working.

I've take another step further - I used bootstrap5 ratio class - and it is loading the pdf file.

 

So:

Using aws s3 to store the pdf files is not working with the API. But working with a simple html tag.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources