Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Sep : idhttp download file problem with https
| Subject: | idhttp download file problem with https |
| Posted by: | "Axel" (borland.public.delphi.internet.winso..@newsgroups.borland.com) |
| Date: | Thu, 14 Sep 2006 17:52:46 |
Hi
I use indi 7 and delphi 7
I try to download a file with https protocol with a function i write down,
that works with http protocol.
The files downloaded are empty (one time it downloaded a html file of the
site)
The link is something like:
https://bollettinoreport.poste.it/bollettinoreport/98331.zip?idRichiesta=98331
If i try to savetofile the link in the browser, it start the download with
the standard IE download windows.
I fault or missed something in the function or i fault the approch??
The indy version is too old??
T.i.a.
Axel
function GetWebFile(sUrl,LnomeCompletoOut:string):boolean;
var T:TMemoryStream;
idhttp1:tidhttp;
FSSL : TIdSSLIOHandlerSocket;
begin
result:=false;
idhttp1:=TIdHTTP.Create(nil);
if pos('https',sUrl)>0 then
begin
FSSL := TIdSSLIOHandlerSocket.Create(idhttp1);
idhttp1.IOHandler := FSSL;
end;
T:=TMemoryStream.create;
try
idHTTP1.Get(sURL,T);
T.SaveToFile(LnomeCompletoOut);
result:=true;
finally
T.Free;
FreeAndNil(idhttp1);
end;
end;