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
Solved

FTP QUESTION..

Posted on 2000-03-22
5
242 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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