Created
September 24, 2016 19:21
-
-
Save amici-fos/2778e4a1e3f75cf7d5e105345e568aef to your computer and use it in GitHub Desktop.
This file contains 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
function ajaxUpload(a){ | |
files=a.files[0];//get file | |
formdata=new FormData(); // created http transport object | |
formdata.append("files",files) ;// append a new value and this is going to send as post | |
ajax=new XMLHttpRequest(); | |
ajax.upload.addEventListener("progress",console.log(1),false) | |
ajax.open("POST","manage.php/upload"); | |
ajax.send(formdata); | |
function progressHandler(e){ | |
console.log(e.loaded/e.total); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment