What code base do you use for your web server? Most web server code serving data from the SD card already includes your needed features with the exception that they don't select the text/csv MIME type if a *.txt file is chosen.

What code base do you use for your web server? Most web server code serving data from the SD card already includes your needed features with the exception that they don't select the text/csv MIME type if a *.txt file is chosen.

pylon,

I am writing code to make my own web server on arduino MEGA so I don't know what code base. Do you mean some sort of encoding binary into alphanumerical code? This needs to be integrated into an existing project so I prefer writing my own code and make it only as powerful as needed not to be capable of processing other things that I don't need. My goal is to put a link on my arduino-generated web page. If it gets clicked, arduino will reply with the file, like if you click on a .csv file link on this webpage (look below) and your browser asks you where to store that file or maybe just displays it on the browser screen. I wanted to know whether my naive thinking is correct.

My initial tests are positive. I can make Arduino serve files to a web client (firefox browser). But the speed is very slow around 70-80 bytes per second. I was reading file from SD card and sending via wifi shield. I'll have to find the reason of this slow speed or it's not practical.

But the speed is very slow around 70-80 bytes per second. I was reading file from SD card and sending via wifi shield. I'll have to find the reason of this slow speed or it's not practical.

My guess is (as was the guess of zoomkat) that you're sending one complete packet for every character you want to transmit. You get a much higher throughput if you take care (by not using the print/println methods but the write(ptr, size) method) that packets contain more than one byte of data.

But the speed is very slow around 70-80 bytes per second. I was reading file from SD card and sending via wifi shield. I'll have to find the reason of this slow speed or it's not practical.

My guess is (as was the guess of zoomkat) that you're sending one complete packet for every character you want to transmit. You get a much higher throughput if you take care (by not using the print/println methods but the write(ptr, size) method) that packets contain more than one byte of data.