{"id":612,"date":"2015-05-22T09:32:12","date_gmt":"2015-05-22T09:32:12","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=612"},"modified":"2024-04-29T04:36:42","modified_gmt":"2024-04-29T04:36:42","slug":"drag-and-drop-file-upload-using-dropzone-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/","title":{"rendered":"Drag and Drop File Upload with DropzoneJS using PHP"},"content":{"rendered":"<p><b>Drag and drop<\/b> is a very effective feature to make the web application user-friendly. Generally, this feature allows you to drag and drop an element to a different location on the web page. The drag-and-drop feature can be used for various purposes in the web application. If you want to make file upload functionality more interactive, drag &#038; drop is the best option.<\/p>\n<p><b>DropzoneJS<\/b> is an open-source JavaScript library that enables an HTML element dropable. This means the user can drag files from the computer and drop them into this HTML element. DropzoneJS provides an easy way to integrate drag and drop multiple file uploads with a preview in the web application. Dropzone is light-weight and does not depend on any other jQuery library.<\/p>\n<p>DropzoneJS does not handle the file upload functionality, it sends the files to the server via AJAX. You need to use PHP to upload files to the server. In this tutorial, we will show you how to integrate <b>drag and drop file upload using DropzoneJS and PHP<\/b>.<\/p>\n<p>The example code helps you to upload multiple images or files to the server without page refresh using Dropzone and PHP. The following steps will be followed to implement the <b>drag &#038; drop file upload<\/b> functionality.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Droppable element to select multiple files from the computer.<\/li>\n<li>Preview of the selected files or images.<\/li>\n<li>Upload files to the server using PHP.<\/li>\n<li>Insert uploaded file information in the database using PHP and MySQL.<\/li>\n<\/ul>\n<p>Before getting started, take a look at the file structure of <b>drag &#038; drop file upload with PHP<\/b>.<\/p>\n<pre class=\"file-struc\">drag_drop_file_upload_with_php<span style=\"color:#794938\">\/<\/span>\r\n\u251c\u2500\u2500 index.html\r\n\u251c\u2500\u2500 dbConfig.php\r\n\u251c\u2500\u2500 upload.php\r\n\u251c\u2500\u2500 uploads<span style=\"color:#794938\">\/<\/span>\r\n\u2514\u2500\u2500 js<span style=\"color:#794938\">\/<\/span>\r\n    \u251c\u2500\u2500 dropzone.min.js\r\n    \u2514\u2500\u2500 dropzone.min.css\r\n<\/pre>\n<h2>Create Database Table<\/h2>\n<p>To store the information of the uploaded file a table is required in the database. The following SQL creates a <code>files<\/code> table with some basic fields in the MySQL database.<\/p>\n<pre><span style=\"color: rgb(149, 65, 33);\">CREATE<\/span> <span style=\"color: rgb(149, 65, 33);\">TABLE<\/span> <span style=\"color: rgb(33, 145, 97);\">`files`<\/span> (\r\n <span style=\"color: rgb(33, 145, 97);\">`id`<\/span> <span style=\"color: rgb(0, 134, 179);\">int<\/span>(<span style=\"color: rgb(64, 160, 112);\">11<\/span>) <span style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span style=\"color: rgb(149, 65, 33);\">NULL<\/span> AUTO_INCREMENT,\r\n <span style=\"color: rgb(33, 145, 97);\">`file_name`<\/span> <span style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span style=\"color: rgb(64, 160, 112);\">255<\/span>) <span style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n <span style=\"color: rgb(33, 145, 97);\">`uploaded_on`<\/span> datetime <span style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n PRIMARY <span style=\"color: rgb(149, 65, 33);\">KEY<\/span> (<span style=\"color: rgb(33, 145, 97);\">`id`<\/span>)\r\n) <span style=\"color: rgb(149, 65, 33);\">ENGINE<\/span>=<span style=\"color: rgb(149, 65, 33);\">InnoDB<\/span> <span style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span style=\"color: rgb(149, 65, 33);\">CHARSET<\/span>=utf8 <span style=\"color: rgb(149, 65, 33);\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<h2>Database Configuration (dbConfig.php)<\/h2>\n<p>The <code>dbConfig.php<\/code> file is used to connect and select the database. Specify the database hostname (<code>$dbHost<\/code>), username (<code>$dbUsername<\/code>), password (<code>$dbPassword<\/code>), and name (<code>$dbName<\/code>) as per your MySQL database credentials.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Database&nbsp;configuration <br \/><\/span><span style=\"color: #0000BB\">$dbHost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"localhost\"<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$dbUsername&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"root\"<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$dbPassword&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"root\"<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$dbName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"codexworld\"<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Create&nbsp;database&nbsp;connection <br \/><\/span><span style=\"color: #0000BB\">$db&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">mysqli<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$dbHost<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbUsername<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbPassword<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbName<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Check&nbsp;connection <br \/><\/span><span style=\"color: #007700\">if&nbsp;(<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">)&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;die(<\/span><span style=\"color: #DD0000\">\"Connection&nbsp;failed:&nbsp;\"&nbsp;<\/span><span style=\"color: #007700\">.&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">); <br \/>}<\/span><\/pre>\n<h2>Drag and Drop File Upload (index.html)<\/h2>\n<p>The DropzoneJS library will be used to integrate Drag&#038;Drop feature, so, include the Dropzone JS and CSS library first.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"js\/dropzone\/dropzone.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">link<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"js\/dropzone\/dropzone.min.css\"<\/span> <span class=\"hljs-attr\">rel<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"stylesheet\"<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\/css\"<\/span> \/&gt;<\/span><\/pre>\n<p>Create a form element with class <code>dropzone<\/code>. Dropzone will attach automatically to this form element and the dropped files data will be posted to the server-side script (specified action URL) for upload.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>The action attribute of the <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span>&gt;<\/span> tag defines the action to perform the server-side upload.<\/li>\n<li>The dropzone class is an identifier of the Dropzone library.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span> <span class=\"hljs-attr\">action<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"upload.php\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"dropzone\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span>&gt;<\/span><\/pre>\n<h2>Upload Files to the Server (upload.php)<\/h2>\n<p>Dropzone sends the dropped files to the server-side script (<code>upload.php<\/code>) to handle the upload process.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Retrieve posted file data using the <b>PHP $_FILES<\/b> method.<\/li>\n<li>Upload files to the server using <b>move_uploaded_file()<\/b> function in PHP.<\/li>\n<li>Insert the file info in the database.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #007700\">if(!empty(<\/span><span style=\"color: #0000BB\">$_FILES<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;database&nbsp;configuration&nbsp;file <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">require&nbsp;<\/span><span style=\"color: #DD0000\">'dbConfig.php'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;File&nbsp;path&nbsp;configuration <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$uploadDir&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"uploads\/\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$fileName&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">basename<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$_FILES<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'file'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'name'<\/span><span style=\"color: #007700\">]); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$uploadFilePath&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$uploadDir<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$fileName<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Upload&nbsp;file&nbsp;to&nbsp;server <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">move_uploaded_file<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$_FILES<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'file'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'tmp_name'<\/span><span style=\"color: #007700\">],&nbsp;<\/span><span style=\"color: #0000BB\">$uploadFilePath<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Insert&nbsp;file&nbsp;information&nbsp;in&nbsp;the&nbsp;database <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$insert&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"INSERT&nbsp;INTO&nbsp;files&nbsp;(file_name,&nbsp;uploaded_on)&nbsp;VALUES&nbsp;('\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$fileName<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"',&nbsp;NOW())\"<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>} <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<h2>Display Uploaded Files<\/h2>\n<p>If you want to display the uploaded files on the web page, you need to fetch the file names from the database and retrieve the respective files from the server.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Include the database configuration file to connect and select the database.<\/li>\n<li>Fetch the files from the database.<\/li>\n<li>Retrieve the files or images from the server (uploads\/) and list them on the web page.<\/li>\n<li>Since, all types of files (image, pdf, word, video, etc.) can be uploaded, <span style=\"color: rgb(186, 98, 54);\">&lt;<span style=\"color: rgb(186, 98, 54);\">embed<\/span>&gt;<\/span> tag can be used to <a href=\"https:\/\/www.codexworld.com\/embed-pdf-document-file-in-html-web-page\/\">display files on the web page<\/a>.<\/li>\n<li>Use the mime_content_type() function to detect the mime type of the file.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;database&nbsp;configuration&nbsp;file <br \/><\/span><span style=\"color: #007700\">require&nbsp;<\/span><span style=\"color: #DD0000\">'dbConfig.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;files&nbsp;from&nbsp;the&nbsp;database <br \/><\/span><span style=\"color: #0000BB\">$query&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;*&nbsp;FROM&nbsp;files&nbsp;ORDER&nbsp;BY&nbsp;id&nbsp;DESC\"<\/span><span style=\"color: #007700\">); <br \/> <br \/>if(<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$filePath&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'uploads\/'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"file_name\"<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$fileMime&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">mime_content_type<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$filePath<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">?&gt; <br \/><\/span>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">embed<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$filePath<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$fileMime<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"350px\"<\/span> <span class=\"hljs-attr\">height<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"240px\"<\/span> \/&gt;<\/span><\/span> <br \/><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">} <br \/>}else{&nbsp;<\/span><span style=\"color: #0000BB\">?&gt; <br \/><\/span>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>No file(s) found...<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span> <br \/><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/drag-drop-images-reorder-using-jquery-ajax-php-mysql\/\">Drag and Drop Reorder Images using jQuery, Ajax, PHP &#038; MySQL<\/a><\/span><\/p>\n<h2>Customize Drag and Drop Upload<\/h2>\n<p>Dropzone provides various configuration options to customize the drag-and-drop file upload. The following example creates a dropzone object programmatically by initializing the Dropzone class, and customize the drag &#038; drop upload.<\/p>\n<p>Include the jQuery library.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.7.1\/jquery.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<p>Initialize the Dropzone class and specify the configuration as per your needs.<\/p>\n<ul class=\"bullet_disk_list\">\n<li><code>url<\/code> &#8211; File path where the files will be submitted for server-side upload.<\/li>\n<li><code>paramName<\/code> &#8211; The name of the file input field.<\/li>\n<li><code>maxFilesize<\/code> &#8211; Maximum size of the file allowed to upload.<\/li>\n<li><code>maxFiles<\/code> &#8211; Maximum number of files allowed to upload.<\/li>\n<li><code>acceptedFiles<\/code> &#8211; Comma-separated list of allowed mime types.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span style=\"color: rgb(110, 107, 94);\"><span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/Disabling autoDiscover<\/span>\r\nDropzone.autoDiscover = <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n\r\n$(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>) <\/span>{\r\n    <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/ Dropzone has been added as a global variable.<\/span>\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> myDropzone = <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">new<\/span> Dropzone(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\".dropzone\"<\/span>, {\r\n        url: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"upload.php\"<\/span>,\r\n        paramName: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"file\"<\/span>,\r\n        maxFilesize: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">2<\/span>,\r\n        maxFiles: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">10<\/span>,\r\n        acceptedFiles: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"image\/*,application\/pdf\"<\/span>\r\n    });\r\n});<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<p>Define the HTML element for dropzone and specify the Dropzone class selector.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"dropzone\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/pre>\n<p><span class=\"note\">Note that:<\/span> If you use the dropzone class, the default style of DropzoneJS will be assigned. For another ID or class, you need to define custom CSS.<\/p>\n<h2>Upload with Button in Dropzone<\/h2>\n<p>By default, the upload starts immediately after you drop files on the dropzone. But you can change this behavior by adding a button. The following example shows you how to start file upload on button click in Dropzone.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Use the <code>autoProcessQueue<\/code> option and processQueue method to submit files on button click.<\/li>\n<li>Set the <code>autoProcessQueue<\/code> option to false, that tells Dropzone not to upload the file on the drop.<\/li>\n<li>Call <code>processQueue()<\/code> method to start sending files.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span style=\"color: rgb(110, 107, 94);\"><span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/Disabling autoDiscover<\/span>\r\nDropzone.autoDiscover = <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n\r\n$(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>) <\/span>{\r\n    <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/ Dropzone has been added as a global variable.<\/span>\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> myDropzone = <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">new<\/span> Dropzone(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\".dropzone\"<\/span>, {\r\n        url: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"upload.php\"<\/span>,\r\n        paramName: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"file\"<\/span>,\r\n        maxFilesize: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">2<\/span>,\r\n        maxFiles: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">10<\/span>,\r\n        parallelUploads: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">10<\/span>,\r\n        acceptedFiles: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"image\/*,application\/pdf\"<\/span>,\r\n        autoProcessQueue: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>\r\n    });\r\n    \r\n    $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#startUpload'<\/span>).click(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>)<\/span>{           \r\n        myDropzone.processQueue();\r\n    });\r\n});<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<p>Define the HTML element for dropzone and button to trigger the upload process.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"dropzone\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">button<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"startUpload\"<\/span>&gt;<\/span>UPLOAD<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">button<\/span>&gt;<\/span><\/pre>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/codeigniter-drag-and-drop-file-upload-with-dropzone\/\">Drag and Drop File Upload with Dropzone in Codeigniter<\/a><\/span><\/p>\n<h2>Conclusion<\/h2>\n<p>This drag-and-drop file upload script provides a user-friendly way to upload images or files to the server. You can use our example code to upload any file types (image\/pdf\/doc\/audio\/video). Various configuration options are available in DropzoneJS, with these the upload functionality can be easily customized as per your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Drag and drop is a very effective feature to make the web application user-friendly. Generally, this feature allows you to drag and drop an element to a different location on the web page. The drag-and-drop <\/p>\n","protected":false},"author":1,"featured_media":5604,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[50,132,66,14,67],"class_list":["post-612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-dragdrop","tag-file","tag-javascript","tag-php","tag-upload","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Drag and Drop File Upload with DropzoneJS using PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"PHP drag and drop file upload using DropzoneJS - Example code to implement the drag &amp; drop multiple images or files upload functionality using Dropzone and PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Drag and Drop File Upload with DropzoneJS using PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"PHP drag and drop file upload using DropzoneJS - Example code to implement the drag &amp; drop multiple images or files upload functionality using Dropzone and PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-22T09:32:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T04:36:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Drag and Drop File Upload with DropzoneJS using PHP\",\"datePublished\":\"2015-05-22T09:32:12+00:00\",\"dateModified\":\"2024-04-29T04:36:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/\"},\"wordCount\":863,\"commentCount\":40,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png\",\"keywords\":[\"Drag&amp;Drop\",\"File\",\"JavaScript\",\"PHP\",\"Upload\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/\",\"name\":\"Drag and Drop File Upload with DropzoneJS using PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png\",\"datePublished\":\"2015-05-22T09:32:12+00:00\",\"dateModified\":\"2024-04-29T04:36:42+00:00\",\"description\":\"PHP drag and drop file upload using DropzoneJS - Example code to implement the drag & drop multiple images or files upload functionality using Dropzone and PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png\",\"width\":1920,\"height\":1080,\"caption\":\"drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/drag-and-drop-file-upload-using-dropzone-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Drag and Drop File Upload with DropzoneJS using PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Drag and Drop File Upload with DropzoneJS using PHP - CodexWorld","description":"PHP drag and drop file upload using DropzoneJS - Example code to implement the drag & drop multiple images or files upload functionality using Dropzone and PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/","og_locale":"en_US","og_type":"article","og_title":"Drag and Drop File Upload with DropzoneJS using PHP - CodexWorld","og_description":"PHP drag and drop file upload using DropzoneJS - Example code to implement the drag & drop multiple images or files upload functionality using Dropzone and PHP.","og_url":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2015-05-22T09:32:12+00:00","article_modified_time":"2024-04-29T04:36:42+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Drag and Drop File Upload with DropzoneJS using PHP","datePublished":"2015-05-22T09:32:12+00:00","dateModified":"2024-04-29T04:36:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/"},"wordCount":863,"commentCount":40,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png","keywords":["Drag&amp;Drop","File","JavaScript","PHP","Upload"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/","url":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/","name":"Drag and Drop File Upload with DropzoneJS using PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png","datePublished":"2015-05-22T09:32:12+00:00","dateModified":"2024-04-29T04:36:42+00:00","description":"PHP drag and drop file upload using DropzoneJS - Example code to implement the drag & drop multiple images or files upload functionality using Dropzone and PHP.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png","width":1920,"height":1080,"caption":"drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/drag-and-drop-file-upload-using-dropzone-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Drag and Drop File Upload with DropzoneJS using PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/05\/drag-drop-file-upload-multiple-images-with-dropzone-js-php-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-9S","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=612"}],"version-history":[{"count":10,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/612\/revisions"}],"predecessor-version":[{"id":5605,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/612\/revisions\/5605"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5604"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}