Chat freely about anything...

User avatar
By Sirquil
#84255
To get the files downloaded search for serveStatic function and point this function to SPIFFS ( https://github.com/me-no-dev/ESPAsyncWe ... -directory ).


Found:

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.

Wiliam
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("Content-Length:");
   client.println("Connnection: close");
   client.println();

   readFile();


Project web page --Served from ESP32

Worked before converting to AsyncWebServer.

William