I am using the dropzone.js plugin to add an image uploader to my application. I know this is probably a really basic question so apologies but what I want to do is limit the file extensions. This works for a single file extension,
<script type="text/javascript">
Dropzone.options.dropzone = {
accept: function(file, done) {
console.log(file);
if (file.type != "image/jpeg") {
done("Error! Files of this type are not accepted");
}
else { done(); }
}
}
</script>
So my question is how to add multiple file extensions, i.e. image/jpeg
, image/png
?
Thanks