You have your work cut out for you. If you have a program that can send a string over a socket, then you can adapt that to your task. You will need some controls to set up the transfer. Send a header that contains the number of blocks. Then a trailer when it is completed to verify.
Calculate a CRC on the file before you send it. Let the remote side recalculate the CRC to ensure that the file is right.
The client side flow would be something like this:
Command line params: ip address, port filename
open socket
open file
send header with name of file
send blocks until whole file is sent
(calculate CRC on file as you go.)
send trailer that includes CRC.
Server side:
start up and listen on socket
accept connection
if read header initiate file, open local file in temp location.
if read block, ensure in reading file status (else error)
if read trailer ensure reading file status. check CRC. close file. Put file where it needs to go.