I've been trying to create (TFileStream) a PDF through the TDownloadURL class, but I'm really having troubles in obtaining the file/stream from the URL, specially if the URL a HTTPS.
I'm not sure if I was clear, but I will post a snippet so it might help understanding:
implementation
var pdfStreamed: TDownloadUrl;
var fileStream : TFileStream;
procedure generateStream;
begin
pdfStreamed:= TDownLoadURL.Create(nil);
with pdfStreamed do
begin
URL := 'https://farm9.staticflickr.com/8327/8106108098_08e298f0d9_b.jpg'; //stream;
FileName := 'D:\';
ExecuteTarget(nil);
// Execute;
end;
end;
The URL property exists both in HTTP as in HTTPS! But it throws me an error: Exception class Exception with message 'Error downloading URL: https://farm9.staticflickr.com/8327/8106108098_08e298f0d9_b.jpg'.
Could point what am I doing wrong? I've searched a lot for this, but couldn't find anything that work and simple!
Thanks a lot!