How can I use TDPFHttp object to download binary data from a web server?
I try also Indy but it doesn't work. The file exists but it's not loaded. If anybody can help.
procedure TFWebView.DPFButton2Click(Sender: TObject); var Http: TIdHTTP; MS: TMemoryStream; begin Http := TIdHTTP.Create(nil); try MS := TMemoryStream.Create; try //Http.OnWork:= HttpWork;
Http.Get('http://www.webdomino.it/test1.jpg', MS); MS.SaveToFile(GetAppFolder + 'test1.jpg'); if fileexists(GetAppFolder + 'test1.jpg') then begin DPFImageView1.ImageList.Clear; DPFImageView1.LoadAsync := true; DPFImageView1.ImageList.Add(GetAppFolder + 'test1.jpg' ); DPFImageView1.ReloadImage; end; finally MS.Free; end;
finally Http.Free; end;
end;
Hi luca
Download last source [code] and see DownloadFile Demo!
Regards
Code: code
Log in to post a comment.
How can I use TDPFHttp object to download binary data from a web server?
I try also Indy but it doesn't work.
The file exists but it's not loaded.
If anybody can help.
procedure TFWebView.DPFButton2Click(Sender: TObject);
var
Http: TIdHTTP;
MS: TMemoryStream;
begin
Http := TIdHTTP.Create(nil);
try
MS := TMemoryStream.Create;
try
//Http.OnWork:= HttpWork;
finally
Http.Free;
end;
end;
Hi luca
Download last source [code] and see DownloadFile Demo!
Regards
Related
Code: code