CaCO3 11 月之前
父節點
當前提交
1ceb47fbc7
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      code/components/jomjol_fileserver_ota/server_ota.cpp

+ 4 - 0
code/components/jomjol_fileserver_ota/server_ota.cpp

@@ -85,6 +85,10 @@ void task_do_Update_ZIP(void *pvParameter)
         outHtmlOld = "/sdcard/html_old";
         outbin = "/sdcard/firmware";
 
+        /* Remove the old and tmp html folder in case they still exist */
+        removeFolder(outHtmlTmp.c_str(), TAG);
+        removeFolder(outHtmlOld.c_str(), TAG);
+
         /* Extract the ZIP file. The content of the html folder gets extracted to the temporar folder html-temp. */
         LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Extracting ZIP file " + _file_name_update + "...");
         retfirmware = unzip_new(_file_name_update, outHtmlTmp+"/", outHtml+"/", outbin+"/", "/sdcard/", initial_setup);