XCS
XCS

Reputation: 28177

Dropzone.js stop from uploading

I use http://www.dropzonejs.com/ so that users can drag&drop images in the browser, so that they can then interact with them using JavaScript, so no server-side is involved.

How can I stop Dropzone.js from trying to upload the files? How can I then access the dragged files via JavaScript (create a new <img> tag containing that image)?

Currently I get this error:

enter image description here

I create the dropzone like this:

        <form   action="/file-upload"
                class="dropzone"
                id="my-awesome-dropzone">
        </form>

I want the functionality to be the same as their demo on their website, where you can drag images but they are not uploaded.

Thanks!

Upvotes: 4

Views: 8611

Answers (2)

asontu
asontu

Reputation: 4659

Maybe try and stop the submitting like this:

<form action="/file-upload"
      class="dropzone"
      id="my-awesome-dropzone"
      onsubmit="return false">
</form>

Upvotes: 0

Hager Aly
Hager Aly

Reputation: 1143

you can set autoProcessQueue:false

autoProcessQueue -> When set to false you have to call myDropzone.processQueue() yourself in order to upload the dropped files. See below for more information on handling queues.

and you can navigate to the tags using jquery

Upvotes: 5

Related Questions