rowanwins / vue-dropzone

A Vue.js component for Dropzone.js - a drag’n’drop file uploads utility with image previews
https://rowanwins.github.io/vue-dropzone/docs/dist
MIT License
2.02k stars 1.4k forks source link

Problem with s3 chunk upload? #542

Closed adnanmuttaleb closed 4 years ago

adnanmuttaleb commented 4 years ago

I added chunking: true to dropzone options, and s3 is uploading chunk correctly but when finish, I get the following message in console:

TypeError: (new window.DOMParser(...)).parseFromString(...).firstChild.children is undefined

Although It works for small file sizes, in other words the vdropzone-s3-upload-success handler fire for small files, but for large files it will not fire?

adnanmuttaleb commented 4 years ago

The response parameter for the success handler is empty, that is why I am getting the parsing error.

I solved it by using the vdropzone-success instead of vdropzone-s3-upload-success:

<vue2Dropzone
  v-on:vdropzone-success="s3UploadSuccess" 
  ...>
</vue2Dropzone>

My handler:

    s3UploadSuccess(file) {
      let s3ObjectLocation = new URL(file.s3Signature.key, file.s3Url).href;
      //do what ever you want
    }
abrichr commented 4 years ago

@adnanmuttaleb how did you get chunking to work correctly? https://github.com/rowanwins/vue-dropzone/issues/544 suggests that chunking is not supported, which matches my experience. The upload completes but the resulting file in S3 is only a fraction of the original file size (where that fraction appears to be the original size divided by the chunk size).