What specifically is your question?
It's commonly done, but there's no built-in function for it.
Here's one way:
On the server side, you
1... Wait for connection
2... Open the file
3... Remainder = determine file size (in bytes)
4... Repeat
5... N = remainder
6... If N > 1024, N = 1024 (limit chunk size )
7... Read N bytes from file.
8... Flatten N to a string of four bytes.
9... Write string to connection.
10... Write N bytes to connection.
11... Remainder = Remainder - N
12... until N = 0.
13... Flatten 0 to a string of four bytes.
14... Send 4-byte string (end-of-file marker).
15... Close File.
16... Close connection.
On the client side, you:
1... Open connection to server.
2... Create (or overwrite) local
file.
3... repeat
4... Read 4 bytes from connection.
5... Unflatten 4 bytes to I32 (N = size of chunk).
6... If N > 0
7... Read N Bytes from connection.
8... Write N bytes to file.
9... until N=0, or error.
10... Close connection.
11... Close file.
You will need to add error-checking to that, but that's the basic idea.
The chunk size can be no more than approx 1500 bytes (I forget the exact number), per IP rules.
If you run both client and server on the same machine, you can use 127.0.0.1 as the IP address, and it will copy a file from one place to another. Use that to test it before bothering with two machines.