Re: D7/Indy - download a file
- From: "Crazy Horse's crazier little brother" <HelpFreeLeonardPeltier...WriteTo: info@xxxxxxx and ask them what's up>
- Date: Thu, 27 Oct 2005 09:23:35 -0500
"Tom" <none@xxxxxxxx> wrote in message
news:435ff567@xxxxxxxxxxxxxxxxxxxxxxxxx
>I know how to use Indy for ftp or html access.
>
> How do I use it to download a file (to disk) at, say,
> www.domainname.com/filename.ext
This works for me:
procedure TForm1.BitBtn1Click(Sender: TObject);
const
sFullPath = 'TheEnd/Of/The/Innocents.mdb';
var
ResultStream: TFileStream;
begin
Screen.Cursor := crHourglass;
try
ResultStream := TFileStream.Create('Innocents.mdb', fmCreate);
try
IdFTP.Host := 'www.DesertRoseBand.cr';
IdFTP.Username := 'chillman';
IdFTP.Password := 'byrds';
IdFTP.Connect;
IdFTP.Login;
IdFTP.Get(sFullPath, ResultStream, True);
IdFTP.Disconnect;
finally
ResultStream.Free;
end;
finally
Screen.Cursor := crDefault;
end;
end;
--
Download the latest draft (version 1.23, updated 10/2/2005) of
"STILL CASTING SHADOWS: Two American Families 1620-2006"
by Blackbird Crow Raven: http://cc.borland.com/ccweb.exe/listing?id=23106
.
- References:
- D7/Indy - download a file
- From: Tom
- D7/Indy - download a file
- Prev by Date: Re: DBGrid with multi-line titles - Part 2
- Next by Date: Re: DBGrid with multi-line titles - Part 2
- Previous by thread: Re: D7/Indy - download a file
- Next by thread: Recommended Anti-Debugging Tool
- Index(es):