There are several problems with that snippet you posted. First, it's impossible to guess what types a number of the instances are. Seeing the whole code, including the #include statements is neccessary.
Second, sending one character at a time in a packet to the client is really not a good idea. Read and buffer a number of characters, and send the whole buffer in one packet.
Third: "it doesn't work" gives us nothing to go on. You are reading data from the file, presumably, though you don't echo to the serial port to confirm that. You don't say what happens on the client end. It's hard to fix issues when we don't know what the problem is.