lwIP webserver download
Basically this problem can be solved by segmenting it into 3 different problems.


Build a webserver (you obviously have that one running)
Save data to SD-Card (obviously this works as well)
Connect the two (this is what we'll be looking at now)


A webserver reacts to a GET (or POST) Request and provides the appropriate Response. To understand these, you will have to lookup the HTTP protocol specs (or some examples). Since there are many examples I will take the first I found when googling for "example HTTP request".

Any browser (or every other tool that uses HTTP) will send something very similar to the one in the example. You can use Wireshark on your PC when opening a webpage and you will see the traffic. Your task not is to get the line starting with "GET" and parse it to find out which file the user is actually requesting. This doesn't really need to be a file on your device, just some binary data.
Say, the user requests the following

GET /infoa.csv HTTP/1.0


What you know by parsing this line is, that the request was for something names infoa.csv. It doesn't matter if that is a file or anything else, as long as the content is what the user expects.

The next task you will have to accomplish is, is to provide the correct response (request and response is the wording used in HTTP). You see an example at the very same page above. The first part is part of the protocol (Pay attention to the Content-Length), the rest can be whatever you desire. To make the browser understand that you're not actually sending some HTML page, you will need to tell him that the content type is application/octet-stream. You could also use text/csv or something similar - depending on what you get. Specifying octet-stream will usually tell the browser: "Oh, this is some random binary data" and since it doesn't know what to do with it, the browser will likely ask you to save the data (File Save Dialog will open up). In the Body of the response you will provide whatever data you have. This data will end up being saved to the file the user selected. Regarding the selection of your MIME-Type (Content-Type) you might want to look up the HTTP specification. Also make sure that the content-length matches your actual data.