Does AWS s3 js upload sdk files directly from browser to s3 bucket? I am currently using the Php SDK I uploaded the files to the server first and then uploaded them to the s3 bucket but this process consumes too much resources I could not find an example on the web I'm waiting for your help
1 Answer
You can upload files directly from your browser using AWS S3 JavaScript SDK.
One approach is to implement a mechanism to request for temporary access credentials directly or indirectly from AWS STS to assume an AWS IAM role that allows S3 upload.
Another approach is to generate AWS S3 Presigned Post using AWS S3 SDK from a backend that sends temporary access credentials to upload content to a private bucket.
For more details check the Examples: Browser-Based Upload using HTTP POST (Using AWS Signature Version 4)
4 Comments
emre
Hello there thanks for your answer Do you have a video for that? I think I need a very complicated video
Ashan
I don't have a video for it, but just updated the answer with an example using a simpler approach using temporary access credentials.
Ashan
I have written a medium article just now, it might help to implement it medium.com/@ashan.fernando/…
emre
Thanks for the article I am starting to examine