Brad
Brad

Reputation: 41

Uploading files to Linux server from Windows C#

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

Answers (2)

Brad
Brad

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

David
David

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

Related Questions