What’s the best way to do this without using FTP?
The client would need to be able to communicate with the server for several simple tasks, such as checking if the file on the client is different from the file on the server. Or issue a “create folder” command. And of course the file transfer itself.
Can this be done using sockets maybe? I could send messages to the server like this:
"checkfileMD5,somefolder/blabla.txt,*MD5HASH*"
And then have the server return 1 or 0 based on whether or not the file MD5 the client sent is the same as what resides on the server.
"createfolder,somefolder/,*NewFolderName*"
Which would create somefolder/NewFolderName on the server.
But is this the best solution, can files even be transfered over sockets (and if so, how?), and do sockets even work cross-platform?
You don’t define what “best” means. To me, best means getting the job done without having to write a lot of new code. How about uploading the file as a form using POST to an HTTP server? Arguments would be authorization information and pathname of file. The server would be listening on port 80 but doesn’t ever need to return a webpage! It could just return a standard HTTP code for success or an error if there is a problem. This way the only thing you have to provide is the CGI to check the request and store the file.