weismat
weismat

Reputation: 7411

FTP c# against Solaris 10 server

I am trying this code to download a file from a Windows machine using C# against a Solaris machine and I receive error 550 - File unavailable.

        string fileName = FileName();
        string remoteUri = "xxxx";
        var webClient = new WebClient();
        webClient.Proxy = null;
        webClient.Credentials = new NetworkCredential(Settings.Default.FtpUser, Settings.Default.FtpPassword);
        webClient.BaseAddress = "ftp://"+Settings.Default.FtpHost;
        webClient.DownloadFile(remoteUri, fileName);

I have validated that the URI works when using it in the address line of an Internet Explorer.
The URI looks like this

ftp://10.99.137.99/opt/scripts/overnight/test.txt

The actual location after the login on the Unix side is

/opt/scripts/overnight/test.txt

on the Unix side.

I am able to view the file after entering my user and password. What am I doing wrong? What other steps can I take? Is there an easy way to use more manual ftp?

Upvotes: 0

Views: 495

Answers (2)

Joel Etherton
Joel Etherton

Reputation: 37543

Here's another interesting article with a different answer:

FtpWebRequest Download File

Upvotes: 1

The Archetypal Paul
The Archetypal Paul

Reputation: 41769

    string remoteUri = "xxxx";

Have you posted the actual code? This is the name of the remote file. It needs to be ftp://10.99.137.99/opt/scripts/overnight/test.txt not xxxx

If it isn't the actual code, can you post the code you are really using?

Upvotes: 0

Related Questions