I want to transfer files across the network using C or C++. What topics should I look up? How can I do this?
+2
A:
You should start by choosing a protocol. HTTPS and SFTP are both good choices, but there are obviously others. Once you have that straight, you can look up choices for client and server libraries.
Matthew Flaschen
2010-03-16 06:18:12
What about FTP??
Arman
2010-03-16 06:24:06
FTP is insecure, and should be used only inside a firewall, or over a secure layer (e.g. http://en.wikipedia.org/wiki/FTPS)
Matthew Flaschen
2010-03-16 06:25:15
@Matthew, the OP doesn't necessarily need to encrypt the transmitted data.
Bertrand Marron
2010-03-16 07:32:47
@tusbar: if you have secure libraries, why not use them? For completeness, there's also scp. libcurl was suggested here: http://stackoverflow.com/questions/360259/sftp-c-library/360276#360276
stefaanv
2010-03-17 10:06:33
+3
A:
I would recommend looking through documentation of Windows Sockets and boost asio.
Dmitry
2010-03-16 06:29:36
+2
A:
While you could use ReadFile
to read the file's contents and then send it over a socket, Windows also provides the TransmitFile
API to enable you to read a file's data and send it over a socket with one system call.
Aaron Klotz
2010-03-16 06:34:40
It also allows you to prepend and append data to the file contents (such as an HTTP header). This is what IIS does.
Aaron Klotz
2010-03-16 19:49:58