I finally got my page so you can save a file from the server to the local machine, however, once it is saved the page doesn't refresh itself or continue doing what it should, it just sits there!
The download function is sent the address of the file to download and the name to call it as variables.
Download function code:
Sub test(ByVal strFilename, ByVal strDownloadFilename)
Dim objStream, fso, objFilestream
' clear the buffer
Response.Buffer = True
' create stream
objStream = Server.CreateObject("ADODB.Stream")
' set as binary
objStream.Type = 1
' check the file exists
fso = Server.CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(strFilename) Then
tbFilter1.txt = "File not found"
' get length of file
objFilestream = fso.GetFile(strFilename)
intFileLength = objFilestream.size
If Len(Trim(strDownloadFilename)) > 0 Then
strDownloadFilename = Trim(strDownloadFilename)
strDownloadFilename = objFilestream.name
' send the headers to the users browser
Response.AddHeader("Content-Disposition", "attachment; filename=" & strDownloadFilename)
Response.Charset = "UTF-8"
' output the file to the browser
' tidy up
objStream = Nothing
objFilestream = Nothing
fso = Nothing
tbFilter1.Text = "Done!"
I can step through past the end, but it doesn't DO anything! The text "Done!" never appears, and there is no postback. If I click something else, I get writing appearing in the background f the website.
Why oh why?!?