I am not having much luck with this. I want to display a pdf that resides on the server in an HTMLViewer control. To make it as simple as possible I put a pdf on my Desktop (Mac OS X). It seems like this should work…
dim myPDFFile as New WebFile
Dim f As FolderItem = SpecialFolder.Desktop.Child("Testing.pdf")
myPDFFile = new WebFile
myPDFFile.MIMEType = "application/pdf"
myPDFFile = WebFile.open(f)
HTMLViewer1.URL = myPDFFile.URL
I get a 404 file not found error in the HTMLViewer…
[quote]404: File Not Found
The requested URL “/E22CB1B4518168ACA14E70DBCC29CF3A/files/5819-4096-6409-9641-9245/Testing.pdf” could not be found. Please check your request and try again.[/quote]
I am struggling to understand how to access the web server’s file system in Xojo so any help would be appreciated.
Wow. So simple. So now my code now looks like this…
Dim f As FolderItem = SpecialFolder.Desktop.Child("Testing.pdf")
myPDFFile = WebFile.Open(f)
myPDFFile.MIMEType = "application/pdf"
HTMLViewer1.URL = myPDFFile.URL