Dropzone show only CSV & XLS files in dialog box
Asked Answered
H

1

5

I used dropzone as CSV/XLS file uploader. I use this option to filter and restrict CSV/XLS file:

acceptedFiles: "text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",

Now I just see XLS file in windows dialog box and doesn't see CSV file. Off course when I change filter drop-down to all files, I see CSV file and select it. But I wanna to method or option to solve this issue.

Do you have any solution for see both XLS/CSV files together?

Hausa answered 24/7, 2018 at 12:58 Comment(1)
Did you try using the file extensions instead of mime types? .csv and .xlsCathiecathleen
C
6

Dropzone.js simply puts the values from the AcceptedFiles attribute directly into the html component.

<input accept="text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">

It looks like text/csv is not an accepted value even though it is a valid mime type. .csv is recommended.

See here HTML Input="file" Accept Attribute File Type (CSV).

Cathiecathleen answered 24/7, 2018 at 13:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.