Why does this not work?
Primus007 opened this issue · 1 comments
void SD_file_download(String filename){
file.open(filename.c_str(), O_READ);
size_t sent = server.streamFile(file, "application/octet-stream");
file.close();
}`
My Includes:
#include "SdFat.h"
#include <ESP8266WiFi.h> // Built-in
#include <ESP8266WiFiMulti.h> // Built-in
#include <ESP8266WebServer.h> // Built-in
#include <ESP8266HTTPClient.h>
#include <ESP8266mDNS.h>
Line 13: #include <ESP8266WebServer.h>
Compiler Errors:
In file included from F:\Eigene Dateien\Arduino\esp_fileserver05\esp_fileserver05.ino:13:0:
C:\Users\pl\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WebServer\src/ESP8266WebServer.h: In instantiation of 'size_t esp8266webserver::ESP8266WebServerTemplate::streamFile(T&, const String&, HTTPMethod) [with T = SdFile; ServerType = WiFiServer; size_t = unsigned int]':
C:\Users\pl\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WebServer\src/ESP8266WebServer.h:177:50: required from 'size_t esp8266webserver::ESP8266WebServerTemplate::streamFile(T&, const String&) [with T = SdFile; ServerType = WiFiServer; size_t = unsigned int]'
F:\Eigene Dateien\Arduino\esp_fileserver05\esp_fileserver05.ino:223:67: required from here
C:\Users\pl\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WebServer\src/ESP8266WebServer.h:185:58: error: 'class SdFile' has no member named 'size'
_streamFileCore(file.size(), file.name(), contentType);
C:\Users\pl\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WebServer\src/ESP8266WebServer.h:185:58: error: 'class SdFile' has no member named 'name'
exit status 1
Fehler beim Kompilieren für das Board LOLIN(WEMOS) D1 R2 & mini.
The server is running.
Any suggestions?
I have no idea, I didn't port SdFat to the ESP8266 core. It was done by Earle F. Philhower here:
https://github.com/earlephilhower/ESP8266SdFat
There are too many conflicts with the built-in SdFat.