Django AWS S3 pdf Embed Integration
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
The Error is:
File preview error: File preview not available, please reload to try again.
Copy link to clipboard
Copied
Just make the AWS file public.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.

