How to Allow Only Images to Upload in Dropzone JS?

By Hardik Savani | June 19, 2020 | Category : jQuery

In this tutorial we will go over the demonstration of dropzone allow only images to upload. you can see dropzone accept only images. Here you will learn dropzone js allow only pdf to upload. dropzone accept only csv file example. i explained simply step by step allow only image in file upload dropzone js.

Sometime we need to allow only images or allow only pdf file to upload or allow only csv file to upload in dropzone js. then i will help you how to set mime types option to accept only needed file type.

Dropzone provide acceptedFiles option where you can set your file type list. If you want to allow only images or pdf or csv then you can see bellow solution.

Allow Only Images:

Dropzone.options.imageUpload = {


acceptedFiles: ".jpeg,.jpg,.png,.gif"


Allow Only PDF:

Dropzone.options.imageUpload = {


acceptedFiles: ".pdf"


Allow Only CSV:

Dropzone.options.imageUpload = {


acceptedFiles: ".csv"





<title>How to Allow Only Images to Upload in Dropzone JS?</title>

<script src=""></script>

<link rel="stylesheet" href="">

<link href="" rel="stylesheet">

<script src=""></script>



<div class="container">

<div class="row">

<div class="col-md-12">

<h2>How to Allow Only Images to Upload in Dropzone JS? -</h2>

<form action="upload.php" enctype="multipart/form-data" class="dropzone" id="image-upload">


<h3>Upload Multiple Image By Click On Box</h3>






<script type="text/javascript">

Dropzone.autoDiscover = false;

var myDropzone = new Dropzone(".dropzone", {

maxFilesize: 10,

acceptedFiles: ".jpeg,.jpg,.png,.gif"





i also added more tutorial about step by step file uploading with dropzone using php and laravel as bellow:

PHP Dropzone File Uploading Example

Laravel Dropzone File Uploading Example

Angular Dropzone File Uploading Example

PHP Dropzone File Upload on Button Click Example

Dropzone Allow Only File to Upload

I hope it can help you...

Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.

We are Recommending you: