Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var drop = $("#upload").dropzone({
- uploadMultiple: "true",
- addRemoveLinks: "true",
- thumbnailWidth: "250",
- thumbnailHeight: "250",
- maxFilesize: "10",
- headers: {
- "title": titles,
- "location": locations,
- "tag": tags
- }
- });
- $("#close").click(function(){
- drop.removeAllFiles(true);
- });
- $(function() {
- Dropzone.options.myAwesomeDropzone = {
- init: function () {
- var myDropZone = this;
- $("#btnRemoveAll").click(function () {
- myDropZone.removeAllFiles();
- }
- );
- }
- };
- });
- mydropzone = new Dropzone("#mydropzone",{
- url: "/dropzone",
- addRemoveLinks : true,
- maxFilesize: 2.0,
- dictResponseError: 'Error uploading file!',
- removedfile: function(file) {
- var name = {file: file.name}
- $.ajax({
- type: 'POST',
- url: '/dropzone_delete',
- contentType: 'application/json',
- data: JSON.stringify(name),
- dataType: 'json',
- success: function (e) {console.log(e);}
- });
- var _ref;
- return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
- }
- });
- // Clear all files
- $("#btn_clear_dropzone").click(function () {
- mydropzone.removeAllFiles();
- mydropzone.removeAllFiles(true);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement