简体   繁体   English

亚马逊s3直接从asp.net通过url上传文件

[英]amazon s3 upload file by url directly from asp.net

I have asp.net application and i want to upload image by url like 我有asp.net应用程序,我想通过URL上传图像

http://www.planwallpaper.com/static/images/images-7_kACPBns.jpg 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. 您可以使用预签名URL让您的客户直接将文件上传到S3存储桶。 There's a nice article here that shows the process on a working example: 这里有一篇很好的文章,展示了一个工作示例的过程:

Browser Uploads to S3 using HTML POST Forms 浏览器使用HTML POST表单上载到S3

Basically you sign the URL and your client uploads the file to AWS using that URL. 基本上您签署了URL,您的客户端使用该URL将文件上传到AWS。 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) 使用POST的基于浏览器的上传(AWS签名版本2)

and for the Version 4 of AWS signature: 以及AWS签名的第4版:

Authenticating Requests in Browser-Based Uploads Using POST (AWS Signature Version 4) 使用POST在AWS浏览器上传中验证请求(AWS签名版本4)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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