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

How to prevent multiple uploads with S3?

Open adnanmuttaleb opened this issue 5 years ago • 1 comments

I want to prevent user from uploading multiple files, things I tried:

  1. I tried to set uploadMultiple to false but still no results.

  2. I tried to invoke disable method when the v-on:vdropzone-file-added event trigger, but this caused the uploading file to cancel.

Uncaught Error: This file can't be queued because it has already been processed or was rejected.
    at o.value (vue2Dropzone.js?92c3:1)
    at eval (vue2Dropzone.js?92c3:1)
    at o.accept (vue2Dropzone.js?92c3:1)
    at o.value (vue2Dropzone.js?92c3:1)
    at o.value (vue2Dropzone.js?92c3:1)
    at HTMLInputElement.eval (vue2Dropzone.js?92c3:1) 
  1. I tried the following options:
dropzoneOptions: {
        maxFiles: 1,
        parallelUploads: 1,
        ...
}

Although a message that says:

You can not upload any more files.

is displayed, but still the awss3 success handler trigger and the file get uploaded.

Details:

My dropzone component:

    <vue2Dropzone
      ref="dropzone"
      id="dropzone"
      :options="dropzoneOptions"
      :awss3="awss3"
      v-on:vdropzone-s3-upload-error="s3UploadError"
      v-on:vdropzone-s3-upload-success="s3UploadSuccess"
    ></vue2Dropzone>

adnanmuttaleb avatar Mar 24 '20 07:03 adnanmuttaleb

This is related to the s3 implementation being not very sophisticated.

rowanwins avatar May 03 '20 13:05 rowanwins