me-no-dev / ESPAsyncWebServer

Async Web Server for ESP8266 and ESP32
3.6k stars 1.17k forks source link

server.serveStatic("/", SPIFFS, "/www/") tested not to work for SPIFFS #1283

Open xuancong84 opened 1 year ago

xuancong84 commented 1 year ago

"Nothing works unless you have physically tested it yourself!" I am pretty sure the developer has not tested serving files in directory on SPIFFS.

Firstly, according to ESP8266 Filesystem "SPIFFS does not support directories, it just stores a flat list of files". Moreover, for SPIFFS, '/' is allowed in the filename, not as directory delimiter. Thus, I am not sure what does "/www/" refer to because SPIFFS does not support directory at all.

Secondly, I have physically tested server.serveStatic("/", SPIFFS, "/www/") on ESP8266 together with all possible variants such as server.serveStatic("/", SPIFFS, "/"), server.serveStatic("/", SPIFFS, ""), server.serveStatic("", SPIFFS, "/www/"), etc. for listing of all files in the flat list. None works.

Maybe directory serving only works for LittleFS.

stale[bot] commented 1 year ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.