Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

event.dataTransfer.files is empty when ondrop is fired?

Okay, I have an element set up to receive a file-drop event, but when I look in event.dataTransfer it is blank. I haven't gotten around to learning the drag-n-drop HTML5 API just yet and am still a little foggy on it. I'm working on it at my site. If you wouldn't mind poking around my code and seeing what's going on, it would be highly appreciated. The entire event object is being logged.

like image 787
nkcmr Avatar asked Jul 20 '12 06:07

nkcmr


1 Answers

It's working fine, it's just a bug with the console.

function onDrop(event) {
    event.preventDefault();
    console.log(event.dataTransfer.files[0]);
}
like image 145
Esailija Avatar answered Sep 29 '22 06:09

Esailija