mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 04:56:53 +03:00
v1.1.1
This commit is contained in:
@@ -338,7 +338,9 @@ esp_err_t handler_ota_update(httpd_req_t *req)
|
||||
std::string in, out, zw;
|
||||
|
||||
in = "/sdcard/firmware/html.zip";
|
||||
out = "/sdcard/html2/";
|
||||
out = "/sdcard/html/";
|
||||
|
||||
delete_all_in_directory(out);
|
||||
|
||||
unzip(in, out);
|
||||
zw = "HTML Update Successfull!<br><br>No reboot necessary";
|
||||
|
||||
@@ -105,6 +105,7 @@ esp_err_t hello_main_handler(httpd_req_t *req)
|
||||
char filepath[50];
|
||||
struct stat file_stat;
|
||||
printf("uri: %s\n", req->uri);
|
||||
int _pos;
|
||||
|
||||
char *base_path = (char*) req->user_ctx;
|
||||
std::string filetosend(base_path);
|
||||
@@ -120,9 +121,15 @@ esp_err_t hello_main_handler(httpd_req_t *req)
|
||||
else
|
||||
{
|
||||
filetosend = filetosend + "/html" + std::string(req->uri);
|
||||
_pos = filetosend.find("?");
|
||||
if (_pos > -1){
|
||||
filetosend = filetosend.substr(0, _pos);
|
||||
}
|
||||
}
|
||||
|
||||
printf("Filename: %s\n", filename);
|
||||
|
||||
printf("File to upload: %s\n", filetosend.c_str());
|
||||
printf("File requested: %s\n", filetosend.c_str());
|
||||
|
||||
if (!filename) {
|
||||
ESP_LOGE(TAG, "Filename is too long");
|
||||
|
||||
Reference in New Issue
Block a user