I have an ASP MVC4 site. I have to create a folder on ftp server and I use this code:
FtpWebRequest ftpWebRequest = (FtpWebRequest)WebRequest.Create("ftp://mysite.altervista.org/newfolder");
ftpWebRequest.Method = WebRequestMethods.Ftp.MakeDirectory;
ftpWebRequest.UsePassive = true;
ftpWebRequest.EnableSsl = true;
ftpWebRequest.Credentials = new NetworkCredential("userTest", "psw123456");
ftpWebRequest.KeepAlive = true;
ftpWebRequest.UseBinary = true;
using (var resp = (FtpWebResponse)ftpWebRequest.GetResponse())
{
Console.WriteLine("Result: " + resp.StatusCode);
}
When I run my site in localhost everything works fine, but when I Publish my site to Azure Website, it returns me an exception: "The remote server returned an error: (530) Not logged in." I think that the problem is not in my code, do I have to change some setting in Azure?
Thank you in advance