mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-31 23:00:53 +03:00
add check if filename longer than 30 characters,
fixed handling after error dialog
This commit is contained in:
@@ -168,6 +168,8 @@ function upload() {
|
|||||||
alert("No file selected!");
|
alert("No file selected!");
|
||||||
} else if (filePath.length == 0) {
|
} else if (filePath.length == 0) {
|
||||||
alert("File path on server is not set!");
|
alert("File path on server is not set!");
|
||||||
|
} else if (filePath.length > 30) {
|
||||||
|
alert("Filename is to long! Use a shorter name.");
|
||||||
} else if (filePath.indexOf(' ') >= 0) {
|
} else if (filePath.indexOf(' ') >= 0) {
|
||||||
alert("File path on server cannot have spaces!");
|
alert("File path on server cannot have spaces!");
|
||||||
} else if (filePath[filePath.length-1] == '/') {
|
} else if (filePath[filePath.length-1] == '/') {
|
||||||
@@ -199,7 +201,7 @@ function upload() {
|
|||||||
xhttp.open("POST", upload_path, false);
|
xhttp.open("POST", upload_path, false);
|
||||||
document.getElementById("status").innerText = "Status: uploading";
|
document.getElementById("status").innerText = "Status: uploading";
|
||||||
xhttp.send(file);
|
xhttp.send(file);
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementById("status").innerText = "Status: processing on ESP32";
|
document.getElementById("status").innerText = "Status: processing on ESP32";
|
||||||
|
|
||||||
@@ -228,6 +230,7 @@ function upload() {
|
|||||||
var _toDo = basepath + "/ota?task=update&file=" + filePath;
|
var _toDo = basepath + "/ota?task=update&file=" + filePath;
|
||||||
xhttp.open("GET", _toDo, false);
|
xhttp.open("GET", _toDo, false);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
|
}
|
||||||
/* ----------------------------- */
|
/* ----------------------------- */
|
||||||
|
|
||||||
document.getElementById("reboot").disabled = false;
|
document.getElementById("reboot").disabled = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user