rowanwins/vue-dropzone

Prevent upload of files not in acceptedFiles list

Opened this issue · 3 comments

I am able to successfully use the acceptedFiles option setting to catch the error event when a wrong mimetype is uploaded, but I would like the users dialogue box to prevent uploading the wrong file type in the first place.

For example, if I only have application/jpeg as an acceptable mimetype, I want that to reflect in their native dialog box when they go to search for files.

How can this be accomplished? Thanks!

UPDATE: So this is interesting.

If I have acceptedFiles set to application/jpeg, I am still able to select the non-JPG files in the dialog box, it throws an error (as expected) and I remove the file in the script.

However, on next attempt to upload a file (without a reload), the dialog box properly disables any non application/jpeg files! This is the expected behavior I want on first attempt.

Hopefully this provides some additional insight to a solution!

facing the same issue when options are set dynamically. @mklahorst did you find any solution?

@zahidhasanemon I did not find a solution.