We help IT Professionals succeed at work.

DropZone - remove selected file

Aleks
Aleks asked
on
1,134 Views
Last Modified: 2016-02-15
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:

 $(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) {
                    });
					
					
					
                }

            }

       });

Open in new window

Comment
Watch Question

Big MontyWeb Ninja at large
CERTIFIED EXPERT

Commented:
i think all you need to do it add

removeLinks: true

to your list of options:

url: "attachments_add.asp?employerid=<%=Request.QueryString("employerid")%>&mode=upload",
autoProcessQueue: false,
.......
removeLinks: true

Author

Commented:
I added it but the only thing I see is an icon with a checkmark. It in fact adds the checkmark to files that have extensions that should not be allowed. And no option to remove it :(

Capture.PNG
Big MontyWeb Ninja at large
CERTIFIED EXPERT

Commented:
def Monday morning, try:

addRemoveLinks: true

Author

Commented:
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
Big MontyWeb Ninja at large
CERTIFIED EXPERT

Commented:
can you post the code for your entire dropzone object? I tested it out and it works here

Author

Commented:
 <!-- 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>

Open in new window



BTW I am using Firefox
Web Ninja at large
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Monday indeed !   Thanks ! it works.

Author

Commented:
Awesome!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.