Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Drag&Drop #132

Closed
krivochenko opened this issue Nov 22, 2015 · 1 comment
Closed

Problems with Drag&Drop #132

krivochenko opened this issue Nov 22, 2015 · 1 comment

Comments

@krivochenko
Copy link

Hi
I try to show images preview before sending:

....
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'.

Thanks for help.

@LPology
Copy link
Owner

LPology commented Dec 29, 2015

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.

@LPology LPology closed this as completed Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants