I have problem when downloading file from SD card via web server. The file downloads correctly, but it's named wrong when downloaded.
What I do is:
open page in web browser with argument ?L=somefile.txt
if(webServer.arg("L")!=""){
String filename=webServer.arg("L");
String dataType = "application/octet-stream";
File dataFile=SD.open(filename);
webServer.streamFile(dataFile, dataType) ;
dataFile.close();
}
The file doesn't save as somefile.txt but saves as file1.dms. Is there a way to correct this? I need the file to be saved as somefile.txt, the same as it is on the SD card.