Download file with Arduino web server?

Hi,

I’m new on Arduino.
First, sorry for my english.
I would like to dowload a .txt file stored in the SD Card by a local network.

I use Arduino UNO, Ethernet Shield with Wiznet W5500.
my .txt file called TEST.txt

With your good informations, i did the following code,
but when i put the IP address in my web browser, I have an automatic dowload of a file called “TEST.txt” but it is totally empty!
I don’t understand why I haven’t my data in my file.

Thank you for your help

codeforum.ino (3.09 KB)

try Content-Length header and longer delay (100ms) before closing