Downloading files > 20kb doesn't work UPDATE: it must be WiFi issue...

AndreasW79:
If i read the length of the file and make client.read() while i < the content length the file gets filled to the original file size but the content is not correct (just some of the first bytes are the same).

Do you check for client.available() before reading a byte? If not, you may be reading faster than the server can send.