I would like to try SPIFFS for ESP8266. I installed the Data upload and everything seems ok, I dont know why I get a error message that the file cannot be opened.
Here is the code:
#include "FS.h"
void setup()
{
Serial.begin(115200);
if(!SPIFFS.begin())
{
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/example.txt", "r");
if(!file){
Serial.println("Failed to open file for reading");
return;
}
Serial.println();
Serial.println("File Content:");
while(file.available()){
Serial.write(file.read());
}
file.close();
}
void loop() {
}