How to handle response of chunk uploading in Dropzone.js?
The popular js media uploading library dropzone.js is quite simple to integrate. It’s document widely had all the information to add it to any project within minutes.

All goes well as long as chunks are being successfully uploaded. The entire process will not notify if there is any error in between the chunks. The worst part is that the chunks will continue uploading till the last chunk of the file occurs.
In this blog, I am going to share how to handle the response of each chunk.
- First, you need to clone the dropzone.js within your project.
- In dropzone.js, under the
_finishedUploadingkey if response is not successful then Add this code in the else condition.
- Basically for each chunk response if there is any error then we will stop the process and throw the respective error.
- After doing these changes, use the customized dropzone.js from your project instead of native one.
- Now go back to the part where you've integrated the dropzone, listen to @error event.
- On listening to the event you can handle the error.
- That's it and you're good to go.
- Happy Coding!

Shyam Verma
Full Stack Developer & Founder
Shyam Verma is a seasoned full stack developer and the founder of Ready Bytes Software Labs. With over 13 years of experience in software development, he specializes in building scalable web applications using modern technologies like React, Next.js, Node.js, and cloud platforms. His passion for technology extends beyond coding—he's committed to sharing knowledge through blog posts, mentoring junior developers, and contributing to open-source projects.


