1
votes

I'm working in a project. In my project i want to implement DropzoneJS.

There is a contact form with dropzone drag & drop file upload option. If the user drag a image to Dropzone, it gets uploaded thats fine, but i dont need those files until he submits the contacts form.

What idea should be done here.

1

1 Answers

2
votes

The reason this happens is DropzoneJS uploads its file asynchronously. This is almost always the best way to handle things, because then your user isn't waiting for a file upload when they submit the form. If you want to send the file with the form, it would probably be better just to use an <input type="file"/>.

Another option is to set autoProcessQueue to false in the dropzone config. This will stop dropzone from automatically uploading the files as they're put into the dropper, but then you have to trigger the process manually (myDropzone.processQueue()). This however will still upload the file separately from your form, so may not be helpful.