?
Solved

problem in ftp-download using wininet.dll

Posted on 2003-11-10
1
Medium Priority
?
617 Views
Last Modified: 2008-03-10
Hi,

I am using wininet.dll APIs to download and upload files from ftp server.
the APIs I am using are as follows :

Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Long, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long

Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Long

Now I want to download the files using Partial name like "somefile*.xml"
These APIs does not seem to work. Can anyone advice me on how to do it.
Please reply asap. Its very urgent.

Kirti
0
Comment
Question by:kirtirani
[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
1 Comment
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 800 total points
ID: 9720050
You can only get one file with FtpGetFile.

What you have to do is pass "somefile*.xml" to FtpFindFirstFile() and InternetFindNextFile() to get a directory listing matching your file pattern.  Then use FtpGetFile on each file in the list you got back.

Here is a link to the FtpFindFirstFile() function.  On the bottom of the page is a link to an example of how to use it.

http://www.mentalis.org/apilist/FtpFindFirstFile.shtml

Regards,

Idle_Mind
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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 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 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…
Suggested Courses

800 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