Solved

FTP QUESTION..

Posted on 2000-03-22
5
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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