Solved

FTP QUESTION..

Posted on 2000-03-22
5
240 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

810 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