lundi 30 mars 2015

Jpg and mpeg files upload incomplete, but not png

I have a strange problem that my Google-fu seems to be failing me on. I'm trying to upload arbitrary file types to a node.js server (Express v3.0.6) through a multipart form.The PNG and text files (that I've tested so far) appear in full, but jpg and mp3 files appear incomplete. It appears that the first chunk of data is streamed in and then the eof event ('end' in Connect) is firing early, however the file size on disk is what I would expect it to be. Maybe a little less.


My AngularJs client submits the files using a multipart/form-data. From what I've researched this can cause problems for Express:


How to disable Express BodyParser for file uploads (Node.js)


http://ift.tt/19BQ9cd


Is there some reason why jpg/mp3 data would trigger the end of stream prematurely, but not the pngs? How do I handle this properly, or is there a work around I should be employing?


Also, if I'm forced to bypass the Express multipart handler, then how do I handle it myself?


Thanks for whatever help I can get...


Aucun commentaire:

Enregistrer un commentaire