节点应用流文件直接上传到Amazon S3 [英] node application stream file upload directly to amazon s3

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

问题描述

您好:)我看直接通过到一个Amazon S3存储有我的节点应用流HTTP POST文件上传的可行性。

Hello :) I'm looking at the feasibility of having my node application stream HTTP POST file uploads directly through to an Amazon S3 Bucket.

我看用强大而诺克斯这一点。

I'm looking at using Formidable and Knox for this.

我不确定的部分是,S3中,需要知道的字节传输之前在文件中的总数。

The part I'm unsure about is that S3 requires that you know the total number of bytes in the file before transmission.

我会是正确的思维,要做到这一点,那么唯一的方法是使用HTML5文件API(并且在Internet Explorer可能是一个ActiveX控件),以检查文件大小在客户端和发送了本作的部分HTTP POST请求?

Would I be right in thinking that the only way to accomplish this then would be to use the HTML5 File API (And possibly an ActiveX control on Internet Explorer) to check the file size on the client and send this as part of the HTTP POST request ?

推荐答案

随着近期CORS的支持,你可以很容易地直接将文件发送到S3,无需将服务器不必处理任何事情。

With the recent CORS support, you can easily send files directly to s3, without your server having to handle anything.

我最近写了一个简短的教程,使用Rails,但同样的服务器只是用来计算某些键,所以它适应EX preSS应该不难的。

I recently wrote a short tutorial, with rails, but again the server is just used to compute some keys, so adapting it to express shouldn't be hard at all.

不过,这样的解决方案,你需要使用的jQuery文件上传插件,你可能不会需要诺克斯

But with such a solution, you'll need to use the jQuery File Upload plugin, and you probably won't need knox

http://pjambet.github.com/blog/direct-upload -to-S3 /

希望它会帮助你。

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

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