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 | |
| parent | 06cd368cd111a4ef61786bc70f1e95eaa3540b5d (diff) | |
Multiple file uploads at oncev1.3
Diffstat (limited to 'html')
| -rw-r--r-- | html/index.html | 2 | ||||
| -rw-r--r-- | html/webbox.js | 11 | 
2 files changed, 8 insertions, 5 deletions
| diff --git a/html/index.html b/html/index.html index 40390e0..80fa1d8 100644 --- a/html/index.html +++ b/html/index.html @@ -15,7 +15,7 @@  				<td class="menusymbol" onclick="showMenu();"><img src="menu.png"/></td>  				</tr>  			</table> -			<input id="uploadfile" type="file" onchange="onUploadFile();" hidden/> +			<input id="uploadfile" type="file" onchange="onUploadFile();" multiple hidden/>  			<table class="menu">  				<tr>  					<td class="firsttd"></td> 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)); | 
