Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Uploading and downloading files to FTP server

$
0
0

Hello everyone!

I am trying to read and write files from my own website using C#.

I manage to upload a file the site using http://msdn.microsoft.com/en-us/library/ms229715%28v=vs.110%29.aspx
and get the following return message "Upload File Complete, status 226 Transfer complete."

But when I try to read the file using:

System.Net.WebClient wc = new System.Net.WebClient();
byte[] raw = wc.DownloadData(URL);
string webData = System.Text.Encoding.UTF8.GetString(raw);
Console.WriteLine(webData);

I get an error saying:

"An unhandled exception of type 'System.Net.WebException' occurred in System.dll
Additional information: The remote server returned an error: (404) Not Found."

What may be the cause of this problem?

Thanks,
Lage


Viewing all articles
Browse latest Browse all 31927

Trending Articles