Dropzone php mysql Example with Demo – Technology

Dropzone php mysql Example with Demo – Technology

In this post we will give you information about Dropzone php mysql Example with Demo – Technology. Hear we will give you detail about Dropzone php mysql Example with Demo – TechnologyAnd how to use it also give you demo for it if it is necessary.

Today, We want to share with you Dropzone php mysql Example with Demo.In this post we will show you Dropzone Multiple Image upload validation, hear for Laravel Dropzonejs Multiple File Upload using jQuery we will give you demo and example for implement.In this post, we will learn about DropzoneJS send additional data Multiple File Upload with an example.

Simple Dropzone php mysql Example with Demo

There are the Following The simple About Simple Dropzone php mysql Example with Demo Full Information With Example and source code.

Another must read:  Age Date of Birth calculation with Counter in javascript

As I will cover this Post with live Working example to develop filestack – DropZone Allowed File Extensions Tutorials, so the How to display existing files on server in Dropzone js using PHP for this example is following below.

Create Index.php File:

List of all Google Adsense, VueJS, AngularJS, PHP, Laravel Examples.

<!DOCTYPE html>
<html>
<head>
    <title>jQuery Ajax Dropzone display uploaded files on server PHP - onlinecode</title>
    <script src="jquery/3.3.1/jquery.min.js"></script>
    <link href='dropzone/5.4.0/dropzone.css' type='text/css' rel='stylesheet'>
    <script src='dropzone/5.4.0/dropzone.js' type='text/javascript'></script>
    <style type="text/css">
      .dz-preview .dz-image img{
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
      }
    </style>
</head>
<body>
  
<div  >
  <h1>jQuery Ajax Dropzone display uploaded files on server in PHP <BR/> onlinecode</h1>
  <div class='content'>
    <form action="do_multipleFilesUplodad.php"  >  
    </form> 
  </div> 
</div>
  
<script type="text/javascript">
  Dropzone.autoDiscover = false;
  $(".dropzone").dropzone({
    init: function() { 
      liveDropzone = this;
      $.ajax({
        url: 'do_multipleFilesUplodad.php',
        type: 'post',
        data: {request: 'get_request'},
        dataType: 'json',
        success: function(response){
  
          $.each(response, function(key,value) {
            var mockFile = { name: value.name, size: value.size};
  
            liveDropzone.emit("addedfile", mockFile);
            liveDropzone.emit("thumbnail", mockFile, value.path);
            liveDropzone.emit("complete", mockFile);
  
          });
  
        }
      });
    }
  });
</script>
  
</body>
</html>

Create Index.php File:

<?php
  
/* Upload PHP To directory Moves*/
$finalDirdata = "upload/";
  
$destination_path = "upload";
if(isset($_POST['request'])){
  $request = $_POST['request'];
}
  
/* Upload file */
if($destination_path == "upload"){
  $msg = "";
  if (move_uploaded_file($_FILES["file"]["tmp_name"], $finalDirdata.$_FILES['file']['name'])) {
    $msg = "Successfully uploaded";
  }else{ 
    $msg = "Error while uploading";
  }
  echo $msg;
  exit;
}
  
/* Read files from */
if($request == 'get_request'){
  $allFiles = [];
  
  $is_dir = $finalDirdata;
  if (is_dir($is_dir)){
    if ($dh = opendir($is_dir)){
      while (($file = readdir($dh)) !== false){
        if($file != '' && $file != '.' && $file != '..'){
          $file_path = $finalDirdata.$file;
          if(!is_dir($file_path)){
             $size = filesize($file_path);
             $allFiles[] = ['name'=>$file, 'size'=>$size, 'path'=>$file_path];
          }
        }
      }
      closedir($dh);
    }
  }
  
  echo json_encode($allFiles);
  exit;
}
Angular 6 CRUD Operations Application Tutorials

Read :

Another must read:  WooCommerce Get Product ID

Summary

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

I hope you get an idea about Simple Dropzone php mysql Example with Demo.
I would like to have feedback on my onlinecode 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.

Hope this code and post will helped you for implement Dropzone php mysql Example with Demo – Technology. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  83  =  93

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US