Skip to content

Instantly share code, notes, and snippets.

@Quiark
Created November 5, 2012 10:23
Show Gist options
  • Save Quiark/4016495 to your computer and use it in GitHub Desktop.
Save Quiark/4016495 to your computer and use it in GitHub Desktop.
upload.html
$("#droparea").bind("drop", function(e){
files = e.dataTransfer.files;
e.preventDefault();
$.each(files,function(index,file){
var form = new FormData();
form.append("myFile", file);
$.ajax({
type: "POST",
/*
beforeSend: function(request) {
request.setRequestHeader("Content-Type", "multipart/form-data; boundary="+boundary);
},
*/
url: "upload",
data: form,
processData: false,
contentType: false,
dataType: 'json',
});
}).done(function(data) { });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment