소스 검색

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) {
 bool MiLightHttpServer::serveFile(const char* file, const char* contentType) {
   if (SPIFFS.exists(file)) {
   if (SPIFFS.exists(file)) {
     File f = SPIFFS.open(file, "r");
     File f = SPIFFS.open(file, "r");
-    server.send(200, contentType, f.readString());
+    server.streamFile(f, contentType);
     f.close();
     f.close();
     return true;
     return true;
   }
   }