jquery - `console.log(responseText);` and `console.log(file);` not displaying any data -
i using following configuration dropzone. problem files uploading in server console.log(response);
, console.log(file);
not displaying content in console. remove link not added picture.
<form action="uploadimages" class="dropzone" id="image-uploader" enctype="multipart/form-data"> <i class="fa fa-image" id="dzopen"></i> </form> <div id="media-upload-previews"> </div> dropzone.options.dz = { paramname: "file", maxfilesize: 10, url: 'uploadimages', previewscontainer: "#media-upload-previews", uploadmultiple: true, paralleluploads: 5, maxfiles: 20, acceptedfiles: "image/*,audio/*,video/*", init: function() { this.on("success", function(file, responsetext) { var response = jquery.parsejson(responsetext); alert(file); alert(responsetext); }); this.on("thumbnail", function(file, dataurl) { $('.select_img').html('<img src="' + dataurl + '" width="50" height="50" alt="">'); }); this.on("removedfile", function(file) { }); } }
edit: here want show image with , height of 50 (insted of default preview) , after uploading want show file, responsetext
value in console can use delete. not showing inage specified width , height , after upload not giving response console how these
tried working http://jsfiddle.net/xrcwrn/y8697re4/4/
$("i#dzopen").dropzone({ paramname: "file", maxfilesize: 10, url: 'uploadimages', previewscontainer: "#media-upload-previews", uploadmultiple: true, paralleluploads: 5, maxfiles: 20, acceptedfiles: "image/*,audio/*,video/*", init: function () { this.on("success", function (file, responsetext) { alert(file); alert(responsetext); console.log(file); }); this.on("thumbnail", function (file, dataurl) { $('#media-upload-previews').append('<img src="' + dataurl + '" width="50" height="50" alt="">'); }); this.on("removedfile", function (file) {}); this.on("complete", function (file) { alert(file); }); } });
Comments
Post a Comment