Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Programmatic FTP using the INET control

Posted on 2001-06-08
5
Medium Priority
?
298 Views
Last Modified: 2012-05-04
I need to capture configuration (.cfg) files from a remote server and copy them all into a folder or specified directory on my pc.  This must be done without API but i can use the library references.  The connection, copying, and transfer of files must be done programatically, that is, with no user interface whatsoever.  I have tried using the inet control but found that the "GET" command must have specified files written to it instead of just being able to call all the files with a wildcard (*.cfg). I guess i need a loop of some sort to grab all of the files off the ftp server and copy them at one instance onto my PC. If anyone has any suggestions and/or comments I would greatly appreciate it. Thanx.
0
Comment
Question by:butlerjo
[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
5 Comments
 

Expert Comment

by:Hormonal
ID: 6168201
Your question doesn't give many details, but I can only think of two main ways you would want to get multiple files.  Either you periodically want to download a specific list of files from a specific FTP server, or you want to go to an FTP server, and download an entire directory of files.  I would assume the latter, since getting a specific list would be trivial, using multiple GET calls.

Basically, you need to get a list of the files contained in a specific directory, which is done using the LS command on an FTP server.  What you should do is connect to the FTP server using the Inet Control, and do a .execute with "LS" as your Operation parameter.  Parse that result (check the help -- you have to use GetChunk), and you've got your list of all the files in that directory.  Now, just move through your list, calling a GET for each file.

I haven't tested any code, but I'm pretty confident it'll do the trick.  Give it a shot.
0
 
LVL 5

Accepted Solution

by:
AndrewDev earned 600 total points
ID: 6168410
Take a look ate these

FTP Transfer Class, using wininet.dll
Includes two extra classes to handle directory listings, plus a sample application.
http://www.freevbcode.com/ShowCode.Asp?ID=1593

FTP Client Using WinInet.dll
http://www.freevbcode.com/ShowCode.Asp?ID=1991

I think the first of the two is better

Good Luck
Andrew

0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6173022
Hi!

I don't know if this is what you want, but here's the file:

Download...
http://www.vb-helper.com/Howto/ftpup.zip

Description: Upload a file using FTP (4K)

That's it!

glass cookie : )

PS Ignore me if it's NA.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7133469
Hi butlerjo,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept AndrewDev's comment(s) as an answer.

butlerjo, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7167888
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Suggested Courses

618 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