You are not logged in.
Pages: 1
Hi,
i fround your page on http://stackoverflow.com/questions/6725 … i-wrapper/ link.
I need file downloader with using wininet and https.
You can write file downloader -like below- with your unit.
Or any sample?
procedure DownloadHTTP(const AUrl : string; DestStream: TStream);
begin
with TIdHTTP.Create(Application) do
try
try
Get(AUrl,DestStream);
except
On e : Exception do
MessageDlg(Format('Erreur : %s',[e.Message]), mtInformation, [mbOK], 0);
end;
finally
Free;
end;
end;
Note: code from http://stackoverflow.com/questions/4521 … component/
Thanks.
Offline
Something like that:
procedure DownloadHTTP(const Server, Port, Url: AnsiString; DestStream: TStream);
var Header,Data: TSockData;
begin
with TWinINet.Create(Server,Port,true) do // Https=true
try
try
if Request(Url,'GET',false,'','','',Header,Data)=200 then
DestStream.Write(Data[1],length(Data));
except
On e : Exception do
MessageDlg(Format('Erreur : %s',[e.Message]), mtInformation, [mbOK], 0);
end;
finally
Free;
end;
end;
Offline
Pages: 1