diff options
author | Roland Stigge <stigge@antcom.de> | 2018-01-20 17:02:32 +0100 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2018-01-20 17:02:32 +0100 |
commit | 54643c4c4cbaa47cd99245c6826f4a78b47229e3 (patch) | |
tree | cf6ee38bc31e821d8c6d81a8170d2a81c2268dd0 /html/webbox.js | |
parent | 06cd368cd111a4ef61786bc70f1e95eaa3540b5d (diff) |
Multiple file uploads at oncev1.3
Diffstat (limited to 'html/webbox.js')
-rw-r--r-- | html/webbox.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/html/webbox.js b/html/webbox.js index 5a55010..72ff987 100644 --- a/html/webbox.js +++ b/html/webbox.js @@ -526,11 +526,11 @@ function onUploadFile() { if (this.status != 200) { message = "HTTP error"; } else { - if (xhr.responseText == "OK") { + if (xhr.responseText == "") { message = "Upload successful."; loadContents(currentDir); // load new file list with uploaded file } else { - message = "Error: " + xhr.responseText; + message = xhr.responseText; } } @@ -544,11 +544,14 @@ function onUploadFile() { progressOff(); } + progressOn(); + var uploadfile = document.getElementById("uploadfile"); var formData = new FormData(); - formData.append("uploadfile", uploadfile.files[0]); - progressOn(); + for (var i = 0; i < uploadfile.files.length; i++) { + formData.append("uploadfile", uploadfile.files[i]); + } xhr.open("POST", "/bin/query" + currentDir + "?command=upload", true); xhr.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password)); |