So I have a web app. I offload the generation of PDF outputs to helper apps. The helper app returns the file name, and then I return this file to the user. or so is the plan.
The webapp is standalone on Windows (result is the same on 8.1 and 10) compiled 32 bit.
I have the same in the IDE on Windows 10.
Xojo 2017 R2
my app uses webcontainers, not pages. So:
- The webfile is a property of the webcontainer.
- The generation of the PDF is handled by the helper app, so this all happens with a shell. I use a handler method on the webcontainer to perform the data available event. Here is the code in the handler method:
[code]’ method sCompL_DA
System.debuglog (“Entering method sCompL_DA”)
Dim CList As String
CList = sPCList.ReadAll
Clist = Trim(CList)
Clist = ConvertEncoding(CList, encodings.UTF8)
'Find printed PDF dicument
Dim fPDF As folderitem
fPDF = New FolderItem(SpecialFolder.Documents.Child(CList))
System.debuglog ("Looking for file: " + fPDF.NativePath)
'Open and show printed document
If fPDF <> Nil And fPDF.Exists Then
System.debuglog ("fPDF NativePath: " + fPDF.NativePath)
Self.PDFFile = WebFile.Open(fPDF)
Self.PDFFile.UseCompression = False
Self.PDFFile.ForceDownload = True
else
System.debuglog (“Folderitem does not exist”)
End If
If Self.PDFFile <> Nil Then
System.debuglog ("PDFFile: " + Self.PDFFile.URL)
ShowURL(Self.PDFFile.URL)
Else
System.debuglog (“Webfile does not exist”)
MsgBox(“The PDF file is not available.”)
End If
'reinitialize document variables
Self.PDFFile = nil
fpdf = Nil
'remove handler
RemoveHandler sCompL.DataAvailable, AddressOf sCompL_DA[/code]
- dbgview reports the following notes:
[3188] Entering method sCompL_DA
[3188] Looking for file: C:\\Users\\WEBSVRADMIN\\Documents\\redbook20162017eng.pdf
[3188] fPDF NativePath: C:\\Users\\WEBSVRADMIN\\Documents\\redbook20162017eng.pdf
[3188] PDFFile: /_files/1848-2687-0187-9593-8189/redbook20162017eng.pdf
It seems that all goes well until I assign the folderitem to the webfile. PDFFile is the webfile in the code above. I get Error 404 instead of the download that I would expect. Is this an error on my part, or did I just happen to stumble on a bug?
Any insight into this problem is welcome!
TIA. LD