Page 1 of 1

esp_http_server to serve files from spiffs

Posted: Sun Dec 02, 2018 11:22 pm
by henk-iot
Im looking to see if it is possible to use the new esp_http_server.
The usecase is to serve files from spiffs, so you can start creating a website.

Current architecture of this server requires me to register a handler for every URI.
I might be overlooking something here, Is there any way to do this usecase of serving files?

A solution could be to allow matching uri-handlers to have a wildcard, and not only a full string match. E.G:
I want to have an uri handler for /spiffs/* so it would respond also to /spiffs/whateverfilename
The handler would then open the file, look at the extention for content-type and serve it.

Re: esp_http_server to serve files from spiffs

Posted: Tue Dec 04, 2018 12:03 pm
by brp80000
https://github.com/nkolban/ESP32_Explorer

files are stored in the spifs section and are given to the browser on request

Re: esp_http_server to serve files from spiffs

Posted: Mon Feb 18, 2019 5:23 am
by ESP_Anurag
It may be too late for an answer, but URI wildcard matching scheme was recently added to esp_http_server. See the file server example offered by esp_http_server https://github.com/espressif/esp-idf/tr ... le_serving. This demonstrates serving files kept on SPIFFS storage