node application stream file upload directly to amazon s3 [duplicate]
Asked Answered
B

2

2

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.

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

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 ?

Bangor answered 21/9, 2012 at 8:15 Comment(0)
S
4

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

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.

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

https://pjambet.github.io/blog/direct-upload-to-s3

Hope it'll help you.

Sisto answered 30/9, 2012 at 21:6 Comment(3)
Blog link goes to a 404 pageBingle
@MuhammadSaleh Thank you, fixed it. That being said, if it you downvoted for this, that's a bit harsh! 😬Sisto
Sorry about that, All is good now!Bingle
I
0

Maybe this can help - I made this to use the JQuery File Upload plugin upload directly to S3. I did not need to check the size of the file.

https://gist.github.com/3995819

Illation answered 1/11, 2012 at 19:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.