emonESP addition - file download

I’m working on making a change to the emonESP web interface, by making a file download button to take a file from an SD card.

I’ve had a close look at an existing sketch, SDWebServer, to find how to do this in the code… I’ve integrated much of the SDWebServer sketch into my version of emonESP however am having trouble finding the html/javascript trigger for a file download in a browser.

Can anyone advise a simple method?

I think what would be useful in the long term in storing data on SD card for bulk transfer also, looking at that afterwards.

here the github: https://github.com/danbates2/emonDC/tree/master/emonDC-ESP_SD/esp-12s%20-%20to%20merge
where the srcDC is the modification of the emonESP src folder.

To download a file it is just a case of adding a link to that file in the HTML.

However I would advise you to hold off on your changes, as there are quite large architecture changes coming to the HTML/JS and the web server, see PR #24.

FYI: Here is an adaption of SDWebServer for ESPAsyncWebServer, GitHub - boblemaire/ESPAsyncSDWebServer: Adaptation of ESP8266SDWebServer using ESPAsyncWebServer

Ah, seems like you’ve already done it. With AsyncWebServer too. I’ll wait to see what you’ve done before I do anything more.
Thanks