Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8k views
in General by
Anyone else have DirDetails not returned a correct directory listing?

If I do a DirDetails and then put a file to the remote server and then do a DirDetails right after the put the second DirDetails returns the same file listing as the first DirDetails, the uploaded file isn't in the listing although it is on the server, I can even close the connection using quit and reconnect and the new DirDetails doesn't show the uploaded file.

However, if I exit and restart my application the first DirDetails will show the uploaded file. This same behavior happens then if I delete the uploaded file from the remote. A DirDetails after a delete still shows the file, but if I issue a delete command again I will get a file not found error. AND THEN then DirDetails will display a correct listing.

The following are the commands I'm issuing in my code after a connection:

// Get a directory listing
txtRemoteDir.Text = ftp.Pwd();
FTPFile[] ftpFile = ftp.DirDetails(txtRemoteDir.Text);

// Upload a file
ftp.TransferType = FTPTransferType.BINARY;
ftp.Put(localFile, FileBeingTransfered);

// Get the new directory listing
txtRemoteDir.Text = ftp.Pwd();
FTPFile[] ftpFile = ftp.DirDetails(txtRemoteDir.Text);

And heres the log:

DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:55.874 : ---> PWD
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:55.937 : 257 "/c:/webhost4life aspnet/cohcc" is current directory.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:55.937 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:55.999 : 227 Entering Passive Mode (66,102,130,66,13,72)
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:56.062 : ---> LIST /c:/webhost4life aspnet/cohcc
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:56.171 : 150 Opening ASCII mode data connection for /bin/ls.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:56.359 : 226-Maximum disk quota limited to 300000 Kbytes
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:56.374 : Used disk quota 105169 Kbytes, available 194830 Kbytes
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:34:56.374 : 226 Transfer complete.
INFO [RoysFTP.MainForm] 26 Mar 2005 10:34:56.374 : DirDetails returned 52 files.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:00.671 : ---> TYPE I
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:00.734 : 200 Type set to I.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:00.734 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:00.812 : 227 Entering Passive Mode (66,102,130,66,13,73)
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:00.874 : ---> STOR parcel.jpg
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:00.952 : 150 Opening BINARY mode data connection for parcel.jpg.
DEBUG [RoysFTP.MainForm] 26 Mar 2005 10:35:00.952 : Transfer Started
DEBUG [RoysFTP.MainForm] 26 Mar 2005 10:35:00.952 : Transferred: 8192
DEBUG [RoysFTP.MainForm] 26 Mar 2005 10:35:01.281 : Transferred: 16384
DEBUG [RoysFTP.MainForm] 26 Mar 2005 10:35:03.437 : Transfer Complete
DEBUG [EnterpriseDT.Net.Ftp.FTPClient] 26 Mar 2005 10:35:03.437 : Transferred 98844 bytes to remote host
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.562 : 226-Maximum disk quota limited to 300000 Kbytes
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.812 : Used disk quota 105266 Kbytes, available 194733 Kbytes
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.812 : 226 Transfer complete.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.812 : ---> PWD
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.874 : 257 "/c:/webhost4life aspnet/cohcc" is current directory.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.890 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:03.952 : 227 Entering Passive Mode (66,102,130,66,13,77)
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:04.015 : ---> LIST /c:/webhost4life aspnet/cohcc
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:04.077 : 150 Opening ASCII mode data connection for /bin/ls.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:05.140 : 226-Maximum disk quota limited to 300000 Kbytes
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:05.312 : Used disk quota 105266 Kbytes, available 194733 Kbytes
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 26 Mar 2005 10:35:05.327 : 226 Transfer complete.
INFO [RoysFTP.MainForm] 26 Mar 2005 10:35:05.327 : DirDetails returned 52 files.

Thanks,

2 Answers

0 votes
by (161k points)
Can you try the same thing using ftp.exe on the command line? Use dir or ls to do a file listing after putting a file.

edtFTP can only return what the FTP server reports is there, and I suspect the FTP server isn't returning the file in its list.

Anyone else have DirDetails not returned a correct directory listing?
0 votes
by
Bruce,

Thanks for the reply.

I agree that the server is not returning the newly uploaded file in it's listing, but I don't quite understand why.

It will work every once and a while (maybe 10 percent of the time), and if I do anything that causes an exception to be throwed (like sending a Delete command on a file that doesn't exist for example) the very next listing WILL include the file.

I just thought maybe there was some command I was missing, because if I use any other FTP client program (WS_FTP Pro) connected to the same sever the listing after any file upload or file delete is always correct. Although my programs log and WS_FTP Pro's log appears to be sending the exact same command sequence.

I'll see about testing with ftp.exe, but because it only supports an active connection I'll have to read up on my router firewall configuration and figured out what I'll need to change before I could test with that.

It's a hack but I was able to code a work around until I can do further testing by doing a Delete on a non-existing file before I do a DirDetails call. Catching and ignoring the File not found exception.

I'll try to do some testing against another server as soon as I get a chance also.

Again Thanks,

Roy Hale
Senior Software Engineer
College for Financial Planning

Categories

...