Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.4k views
in .NET FTP by (400 points)
Hi Support,

In my project I need to download files from my FTP. Over here I need to recursively check my directories and subdirectories for files. Currently I have the facility only to Retrieve files. How can I check whether there is a subdirectory in my FTP? Please advise me on this item.

Many Thanks
Kris

5 Answers

0 votes
by (400 points)
Hi Support,



As a follow up to my previous mail.. In my project I have used FtpConnection class to carry out my transaction. How can we browse thro the sub directories? Please help us on this item....

Thanks for your kind attention and support.

Many Thanks
Kris
0 votes
by (162k points)
There's a method in FTPConnection called GetFileInfos(). It returns an array of FTPFile objects. They indicate if they are files or directories.
0 votes
by (400 points)
Hi Bruce,

Thanks for your prompt response.

I ve jus tried to implement it in my code and i have put them below:

EnterpriseDT.Net.Ftp.FTPFile[] fff = FtpConn.GetFileInfos(strFolder);

When I have a directory with 3 files and 1 subdirectory containing 2 files the array length is given out as 6. In that there are two items which are flagged as directory and their filename are : "." and ".."

Also Please let us know if the above implementation is correct.

Please advise us on this item. Thanks in advance.

Many Thanks
Kris
0 votes
by (162k points)
Hi

That's normal, you can ignore "." and "..".

In unix speak "." is the current directory and ".." is the parent directory. They are generally returned as directories from most servers.



Hi Bruce,

Thanks for your prompt response.

I ve jus tried to implement it in my code and i have put them below:

EnterpriseDT.Net.Ftp.FTPFile[] fff = FtpConn.GetFileInfos(strFolder);

When I have a directory with 3 files and 1 subdirectory containing 2 files the array length is given out as 6. In that there are two items which are flagged as directory and their filename are : "." and ".."

Also Please let us know if the above implementation is correct.

Please advise us on this item. Thanks in advance.

Many Thanks
Kris
0 votes
by (140 points)
Hello Kris - I am brand new to this technology would you mind posting some code for me in this post to get me started with a download routine that browses directories etc?

I would greatly appreciate it.

Thank you

snapurano

Categories

...