diff options
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)); | 
