cannot get a directory listing using FTPSimplicit (General questions)
I am trying to set up an application to retrieve files on a FTPS site. I can connect to the site with no problem. When I call the listdir method, I do not get any directories returned. When I use Core FTP Lite, I can connect and get a directory listing from its interface. After I use Core FTP to connect, it prompts to accept the server's certificate. Do I need to do this in ftpDeluze, and if so, how do I do it. This is our first site we have had to use FTPS on.
Re: cannot get a directory listing using FTPSimpli
Scott,
do you use Passive property set to True or False? Try changing that, it may help.
As for showing certificate. You can also show it to yourself in your app in HostCertificate event, and then there's Accept argument there you can set to True/False if you (don't) want to accept the certificate.
Re: cannot get a directory listing using FTPSimpli
I have set the passive properties both ways and it did not make a difference. I will try to accept the certificate and see if it works.
Re: cannot get a directory listing using FTPSimpli
Scott,
where are you connecting to? Can you paste some debug log to see where it fails? You can get one using FTPReply event.
Re: cannot get a directory listing using FTPSimpli
From the FTPReply
I get the following:
220 Welcome to the XXXXXXXX FTP.
331 Password required for XXXXXXXXXXXXX.
230 Welcome to the XXXXXXXX FTP.
257 /C:/FTP/XXXXXXX/ is current directory.
500 Command not understood.
500 Command not understood.
Re: cannot get a directory listing using FTPSimpli
Scott,
no, I need commands too. You should put something like
Debug.Print Command & & ReplyText
I am specially interested in PORT and PASV commands and what happens after that.
Re: cannot get a directory listing using FTPSimpli
220 Welcome to the PointOne FTP.
USER XXXXXXXXX 331 Password required for XXXXXXXXX.
PASS XXXXXXXXX 230 Welcome to the XXXXXXXXX FTP.
PWD 257 /C:/FTP/XXXXXXXXX/ is current directory.
PBSZ 0 500 Command not understood.
PROT P 500 Command not understood.
I am not sure of the what server I am connecting to.
Re: cannot get a directory listing using FTPSimpli
Ehm.. Did you ever call ListDir method at all?
Re: cannot get a directory listing using FTPSimpli
After the last FTPReply,
I used the following lines of code to loop through the DirItems collection
Set loFTPDirectoryItems = loFTP.DirItems
For Each loFTPDirectoryItem In loFTPDirectoryItems
List1.AddItem * & loFTPDirectoryItem.Name & *
Next
In the home directory of the account on the server, there is a directory called CDR.
Re: cannot get a directory listing using FTPSimpli
But I don't see anywhere PASV or PORT commands. I see last command is PROT, it is sent when you connect. Did you call ListDir in order to access DirItems?
Re: cannot get a directory listing using FTPSimpli
This is the code I am using to connect
Dim loFTPDirectoryItems As wodFtpDLXComLib.DirItems
Dim loFTPDirectoryItem As wodFtpDLXComLib.DirItem
Dim loCert As WODCERTMNGLib.Certificate
List1.Clear
list2.Text = vbNullString
Set loFTP = New wodFtpDLXComLib.wodFtpDLXCom
With loFTP
.LicenseKey = XXXX-XXXX-XXXX-XXXX
.HostName = XXXXXXXXXXXX
.Login = XXXXXXXXXXXXX
.Password = XXXXXXXXXXXXX
.Protocol = FTPSimplicit
.Port = 990
.Passive = True
.StrictHost = True
.Blocking = True
.Connect
End With
List1.AddItem Start of Directory
Set loFTPDirectoryItems = loFTP.DirItems
For Each loFTPDirectoryItem In loFTPDirectoryItems
List1.AddItem * & loFTPDirectoryItem.Name *
Next
List1.AddItem End of Directory
loFTP.Disconnect
Set loFTP = Nothing
Re: cannot get a directory listing using FTPSimpli
Scott,
after you Connect, I don't see any ListDir. DirItems is empty, right?
Re: cannot get a directory listing using FTPSimpli
Yes. DirItems is empty.
Re: cannot get a directory listing using FTPSimpli
Scott,
I have to ask once again. Did you ever call ListDir method?!?
Re: cannot get a directory listing using FTPSimpli
I just added a call to listdir.
220 Welcome to the XXXXXXXXXXXXX FTP.
USER XXXXXXXXXXXXX 331 Password required for 2000682_ADMIN1.
PASS XXXXXXXXXXXXX 230 Welcome to the XXXXXXXXXXXXX FTP.
PWD 257 /C:/FTP/XXXXXXXXXXXXX/ is current directory.
PBSZ 0 500 Command not understood.
PROT P 500 Command not understood.
TYPE A 200 Type set to A.
After calling listdir, i get a the following error:
The current connection has timeout.
Re: cannot get a directory listing using FTPSimpli
I noticed that we are using 2.3.0.1 of the dll. Were they any service releases since then that dealt with FTPS?
Re: cannot get a directory listing using FTPSimpli
Scott,
you can request update for current version at http://www.weonlydo.com/index.asp?update=1 anytime.
As for ListDir call, if it timeouts, it could be someone is behind a firewall - you or the server. Changing Passive property usually helps.
In order to continue - I see we didn't go far after so many posts. Please send me complete FTPReply where PASV or PORT commands are visible. You say that you call ListDir but I don't see it on log.
Also, try to get me similar log from that FTP client you said it worked, so we can compare them.
Thanks!
Kreso