Chat freely about anything...

User avatar
By Sirquil
To get the files downloaded search for serveStatic function and point this function to SPIFFS ( ... -directory ).


Code: Select all    // Serve files in directory "/" when request url starts with "/"
    // Request to the root or none existing files will try to server the defualt
    // file name "index.htm" if exists
    serverAsync.serveStatic("/", SPIFFS, "/");

Code only displays file when a URL is selected; no file download option.

Thank you.

User avatar
By Sirquil
#84261 Using "Chrome," -> "More Tools" -> "Save as" is one way of doing this task.

Method trying to use:

Code from previous web server that enabled file to be download:

Code: Select all   client.println("HTTP/1.1 200 OK");
   client.println("Content-Type: text/plain");
   client.println("Content-Disposition: attachment");
   client.println("Connnection: close");


Project web page --Served from ESP32

Worked before converting to AsyncWebServer.