Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By George Lendel
#72185 Hi all,

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:
Code: Select allopen 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.