开发者

IIS FTP server returned an error: (550) File unavailable (e.g., file not found, no access)

开发者 https://www.devze.com 2023-01-06 02:32 出处:网络
So I set up the FTP server properly in IIS 6.0. Initially I was not able to create or upload files to the FTP servers due to not having the Write permission. Then I gave all the permissions properly.

So I set up the FTP server properly in IIS 6.0. Initially I was not able to create or upload files to the FTP servers due to not having the Write permission. Then I gave all the permissions properly. After that I was able to create or upload files/directory using FileZilla(FTP cli开发者_如何学运维ent for Windows). But from my C# code I am still not able to upload a file into the ftp server using the same credentials that I have used in Filezilla.

The code I am using for uploading file to the FTP server:

        var request = (FtpWebRequest) WebRequest.Create(string.Format("{0}/{1}", _ftpServer, fileName));
        request.Method = WebRequestMethods.Ftp.UploadFile;
        request.KeepAlive = false;
        request.Credentials = new NetworkCredential(_userName, _password);
        //request.UsePassive = false;
        var ftpStream = request.GetRequestStream();

It is giving the 505 error at the last line in the given code.

So, why I am able to create and upload file/directory using the ftp client but not by my C# code?

What I am missing?

EDIT: From code I am able to create directory but not able to upload.

0

精彩评论

暂无评论...
验证码 换一张
取 消