codeigniter 3 Multiple File Drag and Drop Upload

Today, We want to share with you codeigniter 3 Multiple File Drag and Drop Upload using DropzoneJS.In this post we will show you File Upload using dropzone.js and Codeigniter, hear for multiple image upload in codeigniter with database demo we will give you demo and example for implement.In this post, we will learn about codeigniter multiple image upload with preview with an example.

codeigniter 3 Multiple File Drag and Drop Upload using DropzoneJS

There are the Following The simple About codeigniter 3 Multiple File Drag and Drop Upload using DropzoneJS Full Information With Example and source code.

As I will cover this Post with live Working example to develop drag and drop in codeigniter, so the codeigniter 3 multiple file upload for this example is following below.

Also Read :  PHP JQuery Ajax Request POST Data

Step 1: Download Latest version of the CodeIgniter,

You need to first of all, simple Download CodeIgniter version and setup Localsystem.and then here create a new folder application root here display index.php file.

Step 2: Download dropzone.js Setup

here all the Codeigniter dropzone all the folders and files download here https://github.com/enyo/dropzone

Step 3: codeigniter Define a Controller

simple create a main logic of the codeigniter controllers for dropzone.

dropzone.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Dropzone extends CI_Controller {
  
    public function __construct() {
       parent::__construct();
       $this->load->helper(array('url','html','form')); 
    }
 
    public function index() {
        $this->load->view('multiple_files_view');
    }
    
    public function upload() {
        if (!empty($_FILES)) {
        $tmpfiles = $_FILES['file']['tmp_name'];
        $mflname = $_FILES['file']['name'];
        $targetPath = getcwd() . '/uploads/';
        $destination = $targetPath . $mflname ;
        move_uploaded_file($tmpfiles, $destination);
        }
    }
}
 
/* End of include file your main dropzone.js */
/* Your Location Put your Files: ./application/controllers/dropzone.php */

Step 4: codeigniter View File

Make a simple view file all the html elemets

Also Read :  PHP MySQL Column Sorting Examples

multiple_files_view.php

<html>
<head>
<title>File Upload using dropzone.js and Codeigniter</title>
<link href="<?php echo base_url(); ?>resouces/css/dropzone.css" type="text/css" rel="stylesheet" />
<script src="<?php echo base_url(); ?>resouces/dropzone.min.js"></script>
</head>
<body>
<h1>PHP Ajax File Upload using dropzone.js and Codeigniter - pakainfo.com</h1>
<form action="<?php echo site_url('/dropzone/upload'); ?>" class="dropzone"  >
</form>
<a href="https://pakainfo.com/" target="_blank" alt="pakainfo" title="pakainfo">Free Download Example - Pakainfo.com</a>
</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about codeigniter 3 Multiple File Drag and Drop Upload using DropzoneJS.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Gondaliya Jaydeep

Hi, I’m Jaydeep Gondaliya, PHP developer.Pakainfo.com is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development.Any visitors of this site are free to browse our tutorials, live demos, Examples and download scripts.If you have a project that you want to get started, launch quickly, contact me. Email : [email protected]