• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

FTP QUESTION..

hi all
I have an ftp server from where in d\need to bring certain files ...
Now the files in the directory on the FTP Server are being constantly added with the namesz of the file being
1.ind
2.ind
3.ind
and so on

My question is that i wana download the latest .ind file from the FTP Server everytime i log on..
That si if i am connected to the server
i woul;d like to download the 3.ind if it is the latest file..

It would be great if someone could provide asome Vb Code..

Please Reply asap
Regards
Nitin
0
khacharn
Asked:
khacharn
  • 2
  • 2
1 Solution
 
gcs001Commented:
Are you using the Inet control or FTP API function calls?
0
 
khacharnAuthor Commented:
I am using the internet transfer controls.
regrads
Nitin
0
 
rbsubraCommented:
Hi,

what u have asked is there in the net.

i hope it works out......

its an excellent sample code uploading / downloading from /to ftp
http://www.mvps.org/vbnet/code/network/ftplist.htm

njoy ftp'ing.......
cheers
balu
(*_*)
0
 
gcs001Commented:
You should be able to do this using the Inet Control's Execute method.

Here is some sample code that may assist:
' This will list all files ending in .ind in Date/Time order
inet.Execute "ftp://ftp.com", "ls -lt *.ind"

' Let's get the list of directories/file
Do While Len(tempdata) <> 0
   tempdata = inet.GetChunk(1024, icString)
   DoEvents
   strData = strData & tempdata
Loop

The strData variable will then contain information such as Date/Time, etc in each file in the directory.

You can then basically check which file is the latest and then download it using the GET verb on the Execute method.

HTH

Regards,
Grant.
0
 
khacharnAuthor Commented:
Thanx All for you comments and answers..
regards
Nitin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now