0

I have written code for creating folder on FTP server when a button clicks..When running my project locally, It works properly and creates a folder on FTP.. But when it running on remote server the folder is not created.. Please help .. Is there any needs to make changes on config file ? my cod is here

 public void create_folder(string userName, string password,string test_session_id)// FOR CREATING FOLDER ON FTP SERVER
{
    WebRequest request = WebRequest.Create("ftp://xxxxx/" + tb_session_id + "");
    request.Method = WebRequestMethods.Ftp.MakeDirectory;
    request.Credentials = new NetworkCredential(userName, password);

    }
}
ARATHY
  • 349
  • 5
  • 13
  • 29

1 Answers1

0

A few questions:

Is the host (xxxxx in your example) passed to the Create method a reachable domain from your machine/network ?

What is the resp.StatusCode when you debug ?

Are any exceptions thrown ?

A similar issue: https://stackoverflow.com/a/3789350/956364

Other than that, your code looks identical to the version by Jon Skeet: How do I create a directory on ftp server using C#?

Community
  • 1
  • 1
Protiguous
  • 89
  • 2
  • 9