<head>
<link rel="stylesheet" type="text/css" href="./script/dropzone.min.css">
</head>
<form>
<div id="dZUpload" class="dropzone">
<div class="dz-default dz-message"></div>
</div>
</form>
<!-- Use google CDN for jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="./script/dropzone.min.js"></script>
<script>
Dropzone.autoDiscover = false;
$(document).ready(function () {
$("body").dropzone({
url: "http://192.168.1.1/upload.php", //Your URL to upload
addRemoveLinks: true,
previewsContainer: '#dZUpload',
clickable: '#dZUpload',
//If you are using cakephp 3, use this token.
/*headers: {
'X-CSRFToken': $('meta[name="token"]').attr('content')
},*/
success: function (file, response) {
var imgName = response;
//For animation
file.previewElement.classList.add("dz-success");
//To add id to the previews
//file.previewElement.id = response.id;
console.log("Successfully uploaded :" + imgName);
}
});
});
</script>
<link rel="stylesheet" type="text/css" href="./script/dropzone.min.css">
</head>
<form>
<div id="dZUpload" class="dropzone">
<div class="dz-default dz-message"></div>
</div>
</form>
<!-- Use google CDN for jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="./script/dropzone.min.js"></script>
<script>
Dropzone.autoDiscover = false;
$(document).ready(function () {
$("body").dropzone({
url: "http://192.168.1.1/upload.php", //Your URL to upload
addRemoveLinks: true,
previewsContainer: '#dZUpload',
clickable: '#dZUpload',
//If you are using cakephp 3, use this token.
/*headers: {
'X-CSRFToken': $('meta[name="token"]').attr('content')
},*/
success: function (file, response) {
var imgName = response;
//For animation
file.previewElement.classList.add("dz-success");
//To add id to the previews
//file.previewElement.id = response.id;
console.log("Successfully uploaded :" + imgName);
}
});
});
</script>