I believe I need to convert a folder item to a webfile to enable it for browser download. Code below shows relation between OUTFILE (a folderitem) and ReportFile (a webfile).
I am trying to have the browser download the file for the user. For DEBUG I am saving OUTFILE to my desktop prior to assigning it to REPORTFILE for download.
The download fails because of the unusual URL associated with REPORTFILE - this used to work, but no longer does, and I can not figure out why.
Please help.
Outfile Path shows: file:///C:/Users/marka_000/Desktop/TestDoc.pdf
Reportfile Path shows: http://127.0.0.1:8080/44059982DAA84BE84A01BE69346EE947/files/{3703-6754-3451-7626-5047}/TestDoc.pdf
Browser error message: The requested URL “/44059982DAA84BE84A01BE69346EE947/files/%7B3703-6754-3451-7626-5047%7D/TestDoc.pdf” could not be found. Please check your request and try again.
Why the difference?
Dim OUTFILE As FolderItem = SpecialFolder.Desktop.Child(“TestDoc.pdf”)
Dim ReportFile As WebFile
If OUTFILE <> Nil And OUTFILE .Exists Then
ReportFile = WebFile.Open(outfile)
MsgBox "OUTFILE Path: "+outfile.URLPath+EndOfLine+"REPORTFILE Path: "+ReportFile.URL
End If
ShowURL(ReportFile.URL) // Download the file