Article View: borland.public.cppbuilder.internet.socket
Article #5Re: FTP file download for Indy 9
From: Remy Lebeau (TeamB)
Date: Thu, 17 Jul 2008 18:03
Date: Thu, 17 Jul 2008 18:03
49 lines
2214 bytes
2214 bytes
"ANTHONY WEST" <teroni@email.uophx.edu> wrote in message
news:487ef727$1@newsgroups.borland.com...
> I am using Borland builder 4 standard. I have downloaded
> Indy 9 source code that I am attempting to figure out how
> to use, but I do not have a clue on how to begin.
Indy does not officially support BCB 4 anymore.
> - log in to my FTP site using name and password
TIdFTP has UserName and Password properties for that.
> - download the file while showing the download progress
TIdFTP has a Get() method and OnWork... events for that.
Note - in order to use the OnWork events for a progress bar, you have to
retreive the file's size before downloading the actual file. You can use
TIdFTP::Size() or TIdFTP::List() for that.
> // This is where I need FTP code
IdFTP1->UserName = "...";
IdFTP1->Password = "...";
IdFTP1->Host = "...";
IdFTP1->Port = ...;
try
{
IdFTP1->Connect();
try
{
IdFTP1->Get("...");
}
__finally
{
IdFTP1->Disconnect();
}
}
catch(const Exception &e)
{
MessageDlg("Unable to download update. " + e.Message, mtError,
TMsgDlgButtons() << mbOK, 0);
ShowStatusBarMessage("Failed to obtain update.");
}
Gambit
Technical Details
Message-ID:
<487f89d2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<487ef727$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,46736b455fe961ab X-Google-Attributes: gid11508e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <487ef727$1@newsgroups.borland.com> Subject: Re: FTP file download for Indy 9 Date: Thu, 17 Jul 2008 11:03:32 -0700 Lines: 51 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 207.178.157.90 Message-ID: <487f89d2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1216317906 207.178.157.90 (17 Jul 2008 11:05:06 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail