流直接用户上传到Amazon S3 [英] Stream that user uploads directly to Amazon s3

查看:183
本文介绍了流直接用户上传到Amazon S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直挣扎在过去的几天里得到这个工作。

I have been struggling in the last few days to get this working.

基本上我有一个HTML表单,有一个 TYPE =文件输入。

Basically I have a form in HTML that has a type="file" input.

我想,这个文件发送到nodejs,并直接传输到亚马逊的S3。就这样,我会在我的服务器上使用更少的存储空间(想象一下,如果100人上传1G,在结束我的服务器将有100克),所以如果我流,我将只占据内存的时间一点点量

I would like that this file is sent to nodejs and directly streamed to Amazon s3. In this way I will use less storage on my server (imagine if 100 people upload 1g, at the end my server will have 100g), so if I stream I will occupy just memory for a little amount of time

有关如何使用前preSS做任何提示?

Any hint on how to do this with express?

推荐答案

我不能确定,如果你正在寻找一个CORS方法,即用户直接上传到您的S3存储或方法在您使用前preSS作为一个中间人。

I am unsure if you're looking for a CORS approach, where the user uploads directly to your S3 bucket, or an approach where you use express as a middle-man.

如果你正在寻找一个CORS的方法(这也是我建议,除非你正在做什么特殊的事情之前,它被放置在S3中不能做客户端的文件),这应该帮助你:<一HREF =htt​​p://bencoe.tumblr.com/post/30685403088/browser-side-amazon-s3-uploads-using-cors rel="nofollow">http://bencoe.tumblr.com/post/30685403088/browser-side-amazon-s3-uploads-using-cors

If you're looking at a CORS approach (which I would recommend unless you are doing anything special with the file before it gets put in S3 that can't be done client side), this should help you out: http://bencoe.tumblr.com/post/30685403088/browser-side-amazon-s3-uploads-using-cors

如果您计划使用您的服务器作为中间点(即上传到自己的服务器上,然后上传从您的服务器到S3),我听到好东西诺克斯(的 https://github.com/LearnBoost/knox )。我与它周围的发挥,但还没有实际使用它,因为我倾向于使用CORS方法。

If you are planning to use your server as a mid-point (ie, upload to your server, then upload from your server to S3), I have heard good things about Knox (https://github.com/LearnBoost/knox). I've played around with it, but haven't actually used it as I tend to use CORS approaches.

这篇关于流直接用户上传到Amazon S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆