简体   繁体   中英

amazon s3 upload file by url directly from asp.net

I have asp.net application and i want to upload image by url like

http://www.planwallpaper.com/static/images/images-7_kACPBns.jpg

to amazon bucket. How can i upload it directly without download it to my server and upload to amazon.

Note: I need it to reduce the memory without save the image in memory and then upload the image to amazon.

You can let your clients directly upload files to S3 bucket using pre-signed URLs. There's a nice article here that shows the process on a working example:

Browser Uploads to S3 using HTML POST Forms

Basically you sign the URL and your client uploads the file to AWS using that URL. So the file doesn't reach your server. Check out this to see the diagram of the workflow:

Browser-Based Uploads Using POST (AWS Signature Version 2)

and for the Version 4 of AWS signature:

Authenticating Requests in Browser-Based Uploads Using POST (AWS Signature Version 4)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM