HTML5 experiments
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core.js"></script>
<script>
Ext.onReady(function() {
Ext.get("wrapper").on({
drop: function(e) {
e.preventDefault();
var dt = e.browserEvent.dataTransfer,
file = dt.files[0],
formdata = new FormData(),
xhr = new XMLHttpRequest();
formdata.append("nickname", "Foooobar");
formdata.append("website", "http://hacks.mozilla.org");
formdata.append("media", file);
xhr.open("POST", "http://127.0.0.1:8085/"); // requires @shinchi's magic pubsub.js nodejs app
xhr.send(formdata);
},
dragover: function(e) {
e.preventDefault();
},
dragenter: function(e) {
e.preventDefault();
}
});
});
</script>
</head>
<body>
<div id="wrapper" style="height:100%;width:100%;border:1px solid #666666;"></div>
</body>
</html>