vue-s3-dropzone icon indicating copy to clipboard operation
vue-s3-dropzone copied to clipboard

resizeWidth, resizeHeight work?

Open Parkseokje opened this issue 8 years ago • 2 comments

Is the dropzone options all working? resizeWidth, resizeHeight don't seem to work for me.

Parkseokje avatar Nov 20 '17 07:11 Parkseokje

For me it's also not working. My guess is that it's because of the overwritten sending method. Any ideas?

berndartmueller avatar Jan 10 '18 11:01 berndartmueller

Hi! I just add the same issue but I'm not using this module (use mine based on vue2-dropzone and this one).

@berndartmueller, you're right. It's because of hijacking the xhr.send to upload directly the file instead of the formData due to AWS restrictions. See here: https://github.com/kfei/vue-s3-dropzone/blob/master/frontend/src/components/Dropzone.vue#L35

The fact is the file object is not the resized image File but the original one. I finally managed to get the resized image by looking into the given formData object when .send get called.

@kfei, I suggest you to change your function into this:

sending(file, xhr) {
  const _send = xhr.send
  xhr.send = formData => _send.call(xhr, formData.get('file'))
}

mickaelchanrion avatar May 11 '18 16:05 mickaelchanrion