10-11-2019, 05:27 PM
Hi Soren, try use IW Cache system:
From here: https://github.com/Atozed/IntraWeb/blob/.../Unit5.pas
Code:
procedure TIWForm5.IWGradButton1Click(Sender: TObject);
var
xFileName: string;
xURL: string;
begin
// get a new temp file name. This method only returns a file name, the file is not created
xFileName := TIWAppCache.NewTempFileName;
// copy a sample pdf file to our new cache file. We are just simulating a pdf file creation
FileCopy('your_file.pdf', xFileName, True);
// add the pdf file to the cache. cache type is defined as ctOneTime, i.e., the file will be deleted when served
xURL := TIWAppCache.AddFileToCache(Self, xFileName, TIWMimeTypes.GetAsString(mtPDF), ctOneTime);
// open a new window with our PDF file
WebApplication.NewWindow(xURL);
end;