Solved

FTP QUESTION..

Posted on 2000-03-22
5
236 Views
Last Modified: 2010-05-02
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
Comment
Question by:khacharn
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:gcs001
ID: 2648142
Are you using the Inet control or FTP API function calls?
0
 

Author Comment

by:khacharn
ID: 2648297
I am using the internet transfer controls.
regrads
Nitin
0
 

Expert Comment

by:rbsubra
ID: 2648375
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
 
LVL 4

Accepted Solution

by:
gcs001 earned 25 total points
ID: 2648444
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
 

Author Comment

by:khacharn
ID: 2649212
Thanx All for you comments and answers..
regards
Nitin
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now