[New post] Create a pre-signed upload url for AWS S3 using Golang
Chris Owens posted: " Hi everyone, This is just a quick post on how to create a pre-signed upload url for AWS S3 using Golang. The generate the presigned url, you'll need something like the following: package main import ( "fmt" "github.com/joho/godotenv" log "gi"
Respond to this post by replying above this line
New post on What I Broke – JavaScript, C#, AWS and General Development
To test the url you can use something like Postman with the following configuration:
Simply pasting the url into the path should populate the headers for you. As for the body, select "binary" and browse for an image. When you're ready, click "Send".
You should get a 200 OK response and now be able to see your uploaded image in your destination bucket. Unless you've changed the key it should be under the name "test-file.jpg".
One of the main advantages of using a pre-signed url is that it allows you to upload images directly to AWS and bypass your backend server completely. You can also use it to sign image retrievals. This allows you to give the links a limited life-span - great for preventing hot-linking.
Unsubscribe to no longer receive posts from What I Broke – JavaScript, C#, AWS and General Development. Change your email settings at Manage Subscriptions.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.