🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8492

Downloading a file from FTP-server via API: FtpGetFile( )

#8492
From: Oren Halvani
Date: Tue, 19 Oct 2004 12:22
54 lines
2432 bytes
hi dear builders,

hope this is the correct group because its API related...otherwise
i'll
post it to the: internet.web group

my problem: i want to download a file from a FTP server, so i'm using
the API's:

- InternetOpen( )
- InternetConnect( )
- FtpGetFile( )

here's what i'm trying:

/********************************************************/
#include <WININET.h>

void __fastcall TfrmMainUnit::Button1Click(TObject *Sender)
{
   String user = "xxxx", pass = "xxxx";

   HINTERNET handle_Session = InternetOpen("My App", 0, 0, NULL,
INTERNET_FLAG_ASYNC),
             handle_Connect = InternetConnect(handle_Session,
"ftp.halvani.de", 0,
                                              user.c_str(),
pass.c_str(), INTERNET_SERVICE_FTP,
                                               0,
INTERNET_FLAG_ASYNC);

   if(FtpGetFile(handle_Connect, "ftp://www.halvani.de/index.php",
"C:\\",
                 true, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_ASCII,
0))
   {
      ShowMessage("download successfully");
   }
}
/********************************************************/

but when i want to compile it i get these LikerErrors:

[LinkerError] Unresolved external 'InternetOpenA' referenced from
C:\MAINUNIT.OBJ.
[LinkerError] Unresolved external 'InternetConnectA' referenced from
C:\MAINUNIT.OBJ.
[LinkerError] Unresolved external 'FtpGetFileA' referenced from
C:\MAINUNIT.OBJ.

any ideas whats wrong..?


Oren
Technical Details
Message-ID: <4175072a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8c7cb2fd84899d4c,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Oren Halvani" <NoSpam@fdtd.com>
From: "Oren Halvani" <NoSpam@fdtd.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Downloading a file from FTP-server via API: FtpGetFile( )
Date: Tue, 19 Oct 2004 14:22:21 +0200
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 217.86.59.189
Message-ID: <4175072a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1098188586 217.86.59.189 (19 Oct 2004 05:23:06 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail