Uploading a file in ajax to CherryPy
问题 I am trying to upload many files at once to my CherryPy server. I am following this tutorial that shows PHP code on the server side. The JavaScript part is simple. Here is a summary of what it does: function FileSelectHandler(e) { var files = e.target.files || e.dataTransfer.files; for (var i = 0, f; f = files[i]; i++) { var xhr = new XMLHttpRequest(); xhr.open("POST", "upload", true); xhr.setRequestHeader("X_FILENAME", file.name); xhr.send(file); } I translated the upload.php described in