1

Im just starting down my dev journey and need some advice on how to approach a simple app I'm working on. I do not have a good understanding of modern web development.

What I am looking to achieve is to upload a video or image via a browser form / html form to Amazon S3.

Ideally, I want to leverage the AWS node.js SDK but keep my front end as basic as possible (i.e bootstrap page + html changes) I acknowledge that I could do a straight http operation but would still like to leverage the SDK for now.

I have my html,form and css created (using bootstrap), but do not understand how to connect the form to a node.js script that does the authorization/PUT?

Can I even go from the form, and pass the file to the script to be uploaded?

Thanks for any advice!!! :D

2
  • You cannot do it straight from the browser. You need to write some backend code that's gonna upload file to AWS. Commented Aug 13, 2017 at 12:14
  • 1
    @jimmyweb It is possible to upload from browser using AWS JavaScript SDK for S3. You will need a backend to authorize if its a private bucket. Commented Aug 13, 2017 at 16:50

2 Answers 2

1

Check out the AWS documentation. They even have an example for your use case: Uploading Photos to Amazon S3 from a Browser

Sign up to request clarification or add additional context in comments.

Comments

0

You can use, AWS CloudFront Signed URLs to perform the upload. The flow involved are as follows.

  1. From the browser, you will request for a url, with an expiration time, to allow upload a file to a bucket. You can write Sign url creation using NodeJS Backend and AWS SDK as given in this example, after authenticating the user.
  2. Using the Signed URL and AWS JavaScript SDK for S3, browser can directly upload the file to S3.

For more information about Signed URLs, check How Signed URLs Work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.