I am working with dropzone to upload files. code is working fine but the acceptedFiles
variable is not working in the script. the upload script is accepting all formats like .zip,.mp3 which should not be allowed. i have uploaded the dropzone.js
file and see my code below :
My upload script is here :
$(".dropzone2").dropzone({
url: '<?php echo base_url(); ?>docupload',
margin: 20,
acceptedFiles: 'image/*',
params:{
'action': 'save',
'projectId': '<?php echo $this->uri->segment(2) ?>'
},
uploadOnDrop: true,
uploadOnPreview: true,
success: function(res, index){ console.log(index);
$('#fileUpload').modal('hide');
}
});
And the HTml calss is here :
<div class="dropzone2"></div>
actually i found the issue.
The format which worked for me. acceptedFiles:image/jpeg,image/png,image/gif,image/jpg,application/pdf'
. don't know why the image/*
is not working as it was mentioned in the document. Thanks for all experts for their opinion.