Reputation: 41
I have to write a C# program that only needs to work on Windows. It needs to allow the user to select a file to upload. That file will be uploaded to a folder on a remote Linux server. I know the username, password, and url for this Linux machine. Does anyone know how I go about connecting to the server and then uploading the file to it in a C# desktop application?
Upvotes: 2
Views: 7512
Reputation: 41
So I came up with this answer before looking at the first response (David's). Interestingly, we came up with the same solution! An ftp upload was what I was looking for. I completely forgot about FTP.
MSDN also has this web page for a more succinct how-to: http://msdn.microsoft.com/en-us/library/ms229715.aspx
Upvotes: 1
Reputation: 218808
If you're going to upload over FTP, the FtpWebRequest should do the trick:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx
Upvotes: 1