Aleks
asked on
DropZone - remove selected file
I am using DropZone with PureASP to upload multiple documents at once.
It works great, however if a user selects say 5 documents and then realizes one of them should not be uploaded, there is no option, checkbox or anything to remove it from the DropZone. How can I do this ?
This is the script I am currently using:
It works great, however if a user selects say 5 documents and then realizes one of them should not be uploaded, there is no option, checkbox or anything to remove it from the DropZone. How can I do this ?
This is the script I am currently using:
$(document).ready(function(){
Dropzone.options.myAwesomeDropzone = {
url: "attachments_add.asp?employerid=<%=Request.QueryString("employerid")%>&mode=upload",
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 20,
maxFiles: 20,
maxFilesize: 100,
acceptedFiles: ".png,.jpg,.gif,.bmp,.jpeg,.tif,.tiff,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pps,.ppsx,.odt,.zip,.txt,.rtf",
// Dropzone settings
init: function() {
var myDropzone = this;
this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
this.on("sendingmultiple", function() {
});
this.on("successmultiple", function(files, response) {
window.location.href="attachments.asp?employerid=<%=Request.QueryString("employerid")%>";
});
this.on("errormultiple", function(files, response) {
});
}
}
});
ASKER
def Monday morning, try:
addRemoveLinks: true
addRemoveLinks: true
ASKER
Same result as above. I see the green checkmarks but if I mouse over I don't have an option to remove any of the files
can you post the code for your entire dropzone object? I tested it out and it works here
ASKER
<!-- DROPZONE -->
<script src="../../includes/js/plugins/dropzone/dropzone.js"></script>
<script>
$(document).ready(function(){
Dropzone.options.myAwesomeDropzone = {
url: "attachments_add.asp?employerid=<%=Request.QueryString("employerid")%>&mode=upload",
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 20,
maxFiles: 20,
maxFilesize: 100,
acceptedFiles: ".png,.jpg,.gif,.bmp,.jpeg,.tif,.tiff,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pps,.ppsx,.odt,.zip,.txt,.rtf",
addRemoveLinks: true
// Dropzone settings
init: function() {
var myDropzone = this;
this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
this.on("sendingmultiple", function() {
});
this.on("successmultiple", function(files, response) {
window.location.href="attachments.asp?employerid=<%=Request.QueryString("employerid")%>";
});
this.on("errormultiple", function(files, response) {
});
}
}
});
</script>
BTW I am using Firefox
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Monday indeed ! Thanks ! it works.
ASKER
Awesome!
removeLinks: true
to your list of options:
url: "attachments_add.asp?emplo
autoProcessQueue: false,
.......
removeLinks: true