Преглед на файлове

stream file instead of reading into string

Chris Mullins преди 8 години
родител
ревизия
0dd2fd12ef
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      lib/WebServer/MiLightHttpServer.cpp

+ 1 - 1
lib/WebServer/MiLightHttpServer.cpp

@@ -197,7 +197,7 @@ ESP8266WebServer::THandlerFunction MiLightHttpServer::handleServeFile(
 bool MiLightHttpServer::serveFile(const char* file, const char* contentType) {
   if (SPIFFS.exists(file)) {
     File f = SPIFFS.open(file, "r");
-    server.send(200, contentType, f.readString());
+    server.streamFile(f, contentType);
     f.close();
     return true;
   }