From 4204c494aebd594944e1b4aac416cfeb72fb4134 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Fri, 6 Nov 2020 22:41:26 -0800 Subject: [PATCH] fix poorly merged file --- src/meshwifi/meshhttp.cpp | 80 --------------------------------------- 1 file changed, 80 deletions(-) diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp index e4b4b166..d2393a13 100644 --- a/src/meshwifi/meshhttp.cpp +++ b/src/meshwifi/meshhttp.cpp @@ -298,86 +298,6 @@ void middlewareSpeedUp160(HTTPRequest *req, HTTPResponse *res, std::functiongetParams(); - std::string paramValDelete; - - // Set a default content type - res->setHeader("Content-Type", "text/html"); - - if (params->getQueryParameter("delete", paramValDelete)) { - std::string pathDelete = "/" + paramValDelete; - if (SPIFFS.remove(pathDelete.c_str())) { - Serial.println(pathDelete.c_str()); - res->println("File " - "deleted!

File deleted!

"); - res->println("\n"); - res->println(""); - - return; - } else { - Serial.println(pathDelete.c_str()); - res->println("Error deleteing " - "file!

Error deleteing file!

"); - res->println("Error deleteing file!
"); - - return; - } - } - - res->println("

Upload new file

"); - res->println("

*** This interface is experimental ***

"); - res->println("

This form allows you to upload files. Keep your filenames very short and files small. Big filenames and big " - "files are a known problem.

"); - res->println("
"); - res->println("file:
"); - res->println(""); - res->println("
"); - - res->println("

All Files

"); - - File root = SPIFFS.open("/"); - if (root.isDirectory()) { - res->println(""); - - res->println(""); - File file = root.openNextFile(); - while (file) { - String filePath = String(file.name()); - if (filePath.indexOf("/static") == 0) { - res->println(""); - res->println(""); - res->println(""); - res->println(""); - } - - file = root.openNextFile(); - } - res->println("
"); - - if (String(file.name()).substring(1).endsWith(".gz")) { - String modifiedFile = String(file.name()).substring(1); - modifiedFile.remove((modifiedFile.length() - 3), 3); - res->print("" + String(file.name()).substring(1) + ""); - } else { - res->print("" + String(file.name()).substring(1) + - ""); - } - res->println(""); - res->print(String(file.size())); - res->println(""); - res->print("X"); - res->println("
"); - - res->print("
"); - res->print("Total : " + String(SPIFFS.totalBytes()) + " Bytes
"); - res->print("Used : " + String(SPIFFS.usedBytes()) + " Bytes
"); - res->print("Free : " + String(SPIFFS.totalBytes() - SPIFFS.usedBytes()) + " Bytes
"); - } -} void handleStaticPost(HTTPRequest *req, HTTPResponse *res) {