I was doing more research about the Webfile and tried it. The point is why does the compiler complain about it. I’m against a deadline and thought this might get more views as it’s a different heading.
That is creating a text file and it compiles. The example doesn’t mention anything about downloading a binary file.
If TextFile = Nil Then
// Create a text file to download
TextFile = New WebFile
TextFile.MimeType = "text/plain"
TextFile.ForceDownload = True
TextFile.FileName = "TextFile.txt"
Dim d As New Date
d.GMTOffset = Session.GMTOffset
TextFile.Data = "Hello World to " + Session.RemoteAddress + " at " + d.ShortDate + " " + d.ShortTime
// The WebFile.Downloaded event handler is called when the browser
// requests the file for downloading. This code maps that event handler
// to the FileDownloaded method on this web page.
AddHandler TextFile.Downloaded, AddressOf FileDownloaded
End If
// Showing the URL prompts the browser to download it
ShowURL(TextFile.URL)
The help suggests that the best place for this is as an event or method of a webcontrol.
Where it would be called as
me.ShowUrl (…)
Perhaps the fact this is in a module means that there is no suitable ‘me’ to provide the ShowUrl.
What happens if you put it in the action event of a webbutton?