S3 Multipart upload with pause and resume functionality

穿精又带淫゛_ 提交于 2020-01-15 05:30:06

问题


I am trying to achieve s3 multipart upload with pause and resume options. I am using s3-upload-stream npm package for this.

It works fine until user closes the application. When the user closes the application accidentally it means I have to resume the upload manually, so using I am this method as they mentioned:

var upload = s3Stream.upload(
{
    Bucket: "bucket-name",
    Key: "key-name",
    ACL: "public-read",
    StorageClass: "REDUCED_REDUNDANCY",
    ContentType: "binary/octet-stream"
},
{
    UploadId: "f1j2b47238f12984f71b2o8347f12",
    Parts: [
        {
            ETag: "3k2j3h45t9v8aydgajsda",
            PartNumber: 1
        },
        {
            Etag: "kjgsdfg876sd8fgk3j44t",
            PartNumber: 2
        }
    ]
});

I am saving this Etag, partnumber, UploadId in database.

But resuming by this way does not work.

I think the parts are already uploaded are also uploading again this way. because after upload the uploaded file size is larger than original file size and also upload file is corrupted and not able to open.

What am I missing?

来源:https://stackoverflow.com/questions/56412356/s3-multipart-upload-with-pause-and-resume-functionality

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!