Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
....
dropzone: $widget.find('.dropzone'),
....
onChange: function (filename, extension, size) {
var reader = new FileReader();
reader.onload = function (e) {
$widget.find('.new_photo_area').append('<img src="' + e.target.result + '">');
};
reader.readAsDataURL(this._input.files[0]);
},
....
If I choise a file by clicking the dopzone and finding via explorer, it works fine. But, when I try drag and drop file to the .dropzone, property this._input.files is empty and I get error:
Uncaught TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.
Fixed with version 2.3 release. The onChange() callback now receives the selected file as its 5th argument. Feel free to reopen or create another issue if other problems arise. Thanks for your input.
Hi I try to show images preview before sending:
If I choise a file by clicking the dopzone and finding via explorer, it works fine. But, when I try drag and drop file to the
.dropzone
, propertythis._input.files
is empty and I get error:Thanks for help.