So I have a "File" object (retrieved by handling file drag and drop from desktop). I can send the files to the server with ajax, and then throw them back for javascript to handle them. But is it possible to read the contents of it without doing all this?
Here, play around with this fiddle. Drag any file to the box and use the variable file
.
I've already tried all of the methods of this object...no luck. Can you get the contents of the file you just dragged into the browser?
PS: I would send the files to the server like this:
var ajaxRequest = new XMLHttpRequest();
ajaxRequest.open("returnRawPostData.php");
ajaxRequest.send(file);
I might have missed something in the code above, but that's just because one doesn't use plain JS to do AJAX calls anymore.