Please see my comments to the question. There can be different ways to implement it. It could be based on some existing protocols or a custom application-level protocol. Please see
http://en.wikipedia.org/wiki/Application_layer[
^].
As the question is about file transfer only, one of the adequate options is FTP protocol, please see
http://en.wikipedia.org/wiki/FTP[
^].
Server side is more difficult part. Please see this CodeProject article:
Advanced FTP Server[
^].
Client part is pretty simple. You don't really need to use low-level sockets. All you need is the classes
System.Net.FtpWebRequest
and
System.Net.FtpWebResponce
. You can find a code sample here:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[
^].
—SA