I'm trying to do some testing in html5 uploading files,here is the simple html codes:
var fileInput=document.getElementById("the-file")
fileInput.addEventListener('change',function(e){
var file=e.target.files[0]
var xhr=new XMLHttpRequest()
xhr.open('post','upload/handlecode',true)
xhr.send(file)
}
I use
python -m SimpleHTTPServer
to test this section
the problem is that I DON'T know how to write the handlecode file to handle
the http request,
the handlecode file only save the file in the upload floder,no more complicated tasks
Although I don'k know whether testing in this way is right or not
Can someone give some hints or offer me the right way to test ,Thank you all very much!