0

I have an FTP class that I can get the response code (or description) as expected:

        FtpWebResponse response = (FtpWebResponse)request.GetResponse();
        response.StatusCode;

Due to a bug in mono for uploading, we have coded a work around that does not use the FTPWebRequest and related classes but uses the ftp client (on linux).

In .Net/Mono the FtpWebResponse class looks up the code to get the description

        response.StatusDescription

How can I look up the description for the return code that I have from my ftp client?

Barry
  • 417
  • 6
  • 18

1 Answers1

0

The descriptions are not looked up, they are sent by the server as part of the status message. In mono the FtpWebRequest.GetResponseStatus method breaks apart the messages received to get the description.

For a few local error conditions, the code fakes ftp status messages from hard-coded strings, such as:

new FtpStatus (FtpStatusCode.ServiceNotAvailable, Locale.GetText ("Invalid response from server"));

You should probably try to fix whatever bug you have run into instead of hacking together workarounds. That's how open source is supposed to work.

Jester
  • 56,577
  • 4
  • 81
  • 125