Created
March 17, 2017 15:26
-
-
Save pcote/8e3788abbf8e60f8c84a87d8d45f0a52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dropHandler = function(evt){ | |
evt.preventDefault(); | |
var files = evt.originalEvent.dataTransfer.files; | |
var formData = new FormData(); | |
formData.append("file2upload", files[0]); | |
var req = { | |
url: "/sendfile", | |
method: "post", | |
processData: false, | |
contentType: false, | |
data: formData | |
}; | |
var promise = $.ajax(req); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment