Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.2k views
in .NET FTP by (280 points)
I was able to delete files in the root of the FTP site, but when I try to move to a sub-folder, I get a message that Access is Denied. Permissions are inheriting, so all sub-folders have the same permissions as the root folder and I am using the Administrator user name and password for the FTP server machine, so there should be no permissions problems. My code is as follows:

EnterpriseDT.Net.Ftp.FTPClient ftp = new EnterpriseDT.Net.Ftp.FTPClient();
ftp.RemoteHost = "192.168.2.2";
ftp.Connect();
ftp.Login(ftpUser, ftpPassword);
ftp.ConnectMode = FTPConnectMode.ACTIVE;
ftp.TransferType = FTPTransferType.ASCII;
ftp.ChDir("Ack");
ftp.Delete("test.ack");
ftp.Quit();

I have tried both ACTIVE and PASV for the FTPConnectMode. As I said, this code works flawlessly if I use it to delete files from the root but when I try to move to a subfolder, it throws this error:

EnterpriseDT.Net.Ftp.FTPException
test.ack: Access is denied. (code=550)

Any ideas why it's doing this?

6 Answers

0 votes
by (162k points)
1. Post the log file
2. What happens with ftp.exe?
0 votes
by (280 points)
DEBUG [HostNameResolver] 20 Jul 2008 17:23:28.961 : 192.168.2.2 resolved to 192.168.2.2
DEBUG [FTPClient] 20 Jul 2008 17:23:28.992 : Connecting to 192.168.2.2:21
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.008 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.008 : Command encoding=System.Text.ASCIIEncoding
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.008 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.024 : 220 dimond Microsoft FTP Service (Version 5.0).
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.024 : ---> USER ftpUser
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.024 : 331 Password required for ftpUser.
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.039 : ---> PASS ********
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.055 : 230 User ftpUser logged in.
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.055 : ---> TYPE A
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.055 : 200 Type set to A.
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.055 : ---> CWD ack
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.071 : 250 CWD command successful.
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.071 : ---> DELE test.ack
DEBUG [FTPControlSocket] 20 Jul 2008 17:23:29.086 : 550 test.ack: Access is denied.
INFO [FTPControlSocket] 20 Jul 2008 17:23:29.086 : Expected reply codes = [200,250] (strict=False)
0 votes
by (280 points)
Where would I go to get the FTP.EXE executable?
0 votes
by (280 points)
Okay, I found the FTP.exe. It gives me the same results. Using he administrator login and password of the remote server, I get a 550 Access is denied message. But I can delete files in the root folder.
0 votes
by (280 points)
I deleted the target folder, then recreated it and put a new file in it. I was then able to delete the file. Then I tried it again and get Access Denied again. It seems to be completely random as to when it throws the Access Denied message. This happens with FTP.EXE as well. BTW< I am using the new version 1.3.0 with C# 2.0.
0 votes
by (162k points)
I suggest you play with ftp.exe until you get it working. If there's a problem with any client, it'll be easier to figure it out this way.

Categories

...