Hello All,
I am currently using Web API1 - is there a way to download a file without the browser opening up a new tab each time?
I’ve tried several things including setting wf.ForceDownload = false, but that only kills the session by displaying the pdf on the same tab.
Tim
dim fTmp as FolderItem = GetTemporaryFolderItem
RunPDFReport("Report.pdf", m_oDoc, fTmp)
if fTmp = nil then Return
wf = WebFile.open(fTmp)
wf.Filename = ReportNme + ".pdf" //"Report.pdf"
wf.MIMEType = "application/pdf"
wf.ForceDownload = true //Needs to be true so it doesn't open it in the same browser window (thus killing the session).
// To open a new tab and display the pdf file do this:
// showURL wf.url
// Added 062023d version
If wf.Download Then // This causes the file to be downloaded
Dim F1 As New FolderItem("C:\Temp\" + ReportNme + ".pdf") // Set a location to save the file
Dim f As FolderItem = New FolderItem(fTmp)
If f <> Nil And f.Exists Then
F.CopyFileTo(f1)
End If
End If