Solved

problem in ftp-download using wininet.dll

Posted on 2003-11-10
1
610 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 85

Accepted Solution

by:
Mike Tomlinson earned 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 52
Excel - Save a copy of work book 13 91
VB6 - Convert HH:MM into Decimal 8 70
Add and format columns in vb6 7 70
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

749 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