Delphi .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
Download a file from the web (internet)
2 comments. Current rating: (2 votes). Leave comments and/ or rate it.
Question:
Is there an easy function to download a file via http protocol?
Answer:
Yes, there is. It's called UrlDownloadToFile() and it's defined in unit URLMon. The code below shows how to use it.  | |  | | uses
URLMon;
function DownloadFile(SourceFile, DestFile: string): Boolean;
begin
try
Result := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;
except
Result := False;
end;
end;
| |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
|
|
|
|
thanks a lot
I think it is the easiest way
Piotr Borowski
|
|
|
|
|
Thanks - It rare to be able to find a cut and paste solution!
|
|