Skip to content

Instantly share code, notes, and snippets.

@jagroop
Created June 20, 2018 09:20
Show Gist options
  • Save jagroop/22f6431649bf6eec7c927d2878bd1cd8 to your computer and use it in GitHub Desktop.
Save jagroop/22f6431649bf6eec7c927d2878bd1cd8 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<!-- include dropzone script & style -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.js"></script>
</head>
<body>
<div class="dropzone" id="dropzoneUploader"></div>
<script>
Dropzone.autoDiscover = false;
$(document).ready(function(){
var myDropzone = $("div#dropzoneUploader").dropzone({
url: "http://localhost/dev/upload.php",
params: {name : 'jagroop singh'},
maxFilesize: 10,
uploadMultiple: true, // uplaod files in a single request
parallelUploads: 100, // use it with uploadMultiple
acceptedFiles: ".png, .jpg, .jpeg, .gif",
});
// myDropzone.on("sending", function(file, xhr, formData) {
// // Will send the filesize along with the file as POST data.
// formData.append("filesize", 'ss');
// });
// console.log(myDropzone);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment