If you are using Dropbox.js for file uploading and wants to upload some specific extension type like csv, xls etc. Please follow the below code::
Dropzone.options.uploadcontact = {
maxFilesize: 10, // Mb
acceptedFiles: ".xls,.xlsx,.csv", // accepted file type
maxFiles: 1,
init: function () {
// Set up any event handlers
this.on('complete', function (file,done) {
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
if (this.files[1]!=null){
this.removeFile(this.files[0]);
}
if (this.getRejectedFiles().length === 1) {
//alert("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
}else{ window.location.href = "list-uploaded-contact"; // form action
}
}
});
}
};
0 Comment(s)