On May 4, 2012, at May 4, 20126:30 PM, Andrew Chilton wrote: > Hi all and Mikael, > > On 5 May 2012 13:15, Mikeal Rogers <[email protected]> wrote: >> "to stream uploaded files to Amazon S3" is misleading. >> >> You're not streaming the file from the upload, you're writing the entire >> file to disc and then uploading it to S3. I would assume a "streaming" >> library would stream the actual input. > > You're right in that respect. I had planned on doing it the way you > suggested however when I used express.bodyParser() I realised that the > files were already on disk so decided to use that. It can however then > stream more than one of those uploads concurrently which is a good > bonus. > > I'd love to do it the way you suggested but had initially thought it > might be a lot of duplication that was already being done in the above > middleware. I will have a look at that soon but wanted to get this > initial version out there. :) > > Maybe the logic goes: > > * if req.files exists then stream from disk (ie. express.bodyParser() > has already been used) > * if not, then decode the streams like express.bodyParser() does and > upload that way
Ultimately it's your call, but, waiting for it to finish streaming to disc only increases the window of time a crash might prevent the file from actually being persisted. Also, are you passing the response info (status, headers, etc) from S3 to the application response in express? It would be nice if this were "transactional" and didn't return a 201 until it was actually persisted in S3. > > Anyway, v0.2.0 is certainly usable and does a good job. I guess for > v0.3.0 I'll go and decipher the express.bodyParser() middleware and > have a crack at it in a more proper way. Apologies for misleading you > - I'll let you know when I have something a little more expected. :D > > Cheers, > Andy > > -- > Andrew Chilton > e: [email protected] > w: http://www.appsattic.com/ > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
