dropzone.js image upload acceptedMimeTypes
thanks enyo it worked ....awesome...just paste that line in dropjone.js->
uploadMultiple: true, //upload multiple files
maxFilesize: 1, //1 mb is here the max file upload size constraint
acceptedFiles: ".jpeg,.jpg,.png,.gif",
http://www.dropzonejs.com/#config-acceptedFiles
The default implementation of accept checks the file's mime type or extension against this list. This is a comma separated list of mime types or file extensions. Eg.:
'image/*,application/pdf,.psd'
If the Dropzone is clickable this option will be used as accept parameter on the hidden file input as well.
I'm the author of Dropzone.
You should use the acceptedMimeTypes
acceptedFiles
. This behaves exactly the same as the input
element's accept
property. This way, even the fallback will work properly.
Valid acceptedFiles
properties can look like this:
audio/*
image/*
image/jpeg,image/png
- etc...
EDIT: in the latest versions of Dropzone this property is called acceptedFiles
and it allows you to also define extensions. So this would work:
"audio/*,image/*,.psd,.pdf"
(For backwards compatibility acceptedMimeTypes
will still work until the next major release)