nathanpeck / s3-upload-stream

A Node.js module for streaming data to Amazon S3 via the multipart upload API
MIT License
347 stars 46 forks source link

ERROR while uploading or videos corruption issue #52

Open FirdousNath opened 6 years ago

FirdousNath commented 6 years ago

I found some abnormal behaviour sometimes while uploading of videos, say I need to upload 140 MB of data. So below event is called after uploading is finished upload.on('uploaded', function (details) { console.log(details); });

But when I checked the actual file its was of 120MB where my max part size was 20MB, So my wild guess is that maybe a single part is not uploaded succesfully upload.on('part', function (details) { console.log(details); });

Do we have similar method called 'part-error' so that we can handle such situation ?

vinilana commented 6 years ago

Hi @FirdousNath are you using the zlib as the documentation suggest? Maybe the difference between the file sizes is about this, because zlib reduce the file size to upload. If are you using the main repo example try to change this line read.pipe(compress).pipe(upload); to this read.pipe(upload); You will see that the file will have the same size as you see in you computer. If it solves your problem then you could remove the compress const and the zlib from your project. Also, they offer a method to see the upload status details part by part, if you use that upload.on('part', function (details) { console.log(details) }) you will be able to see in real time on your console the status of upload and detect if something doesn't work well.

Hope this helps 👍

FirdousNath commented 6 years ago

I am using same as you stated above @vinicius97 this is exact code I am using this