There are several online networking tutorials online (Beej is a good google term) - I'll assume that you have read these and will ask direct questions on points you do not understand.
The answer to your question, then, is that you
open socket, listen and accept the client connection
read from the client what file to serve
open the file on the server
read the file chunk by chunk
each chunk read from file should be written to the socket