4
votes

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!

3
Where is your Javascript/jQuery part? - Ron van der Heijden
What jQuery part? Dropzone doesn't require any jQuery to work. - XCS
I have the same problem only my error is 419. Did you manage to solve it? - Kira
@KiraArik Unfortunately I can't remember how I fixed the issue, I think I edited code in the library. Anyway this question is 4 years old and not relevant anymore probably (library has been updated since). - XCS

3 Answers

5
votes

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

0
votes

Maybe try and stop the submitting like this:

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

Worked for me