Sfoglia il codice sorgente

stream file instead of reading into string

Chris Mullins 8 anni fa
parent
commit
0dd2fd12ef
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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;
   }