
Text file download dialog box for netscape browser
Hi,
I already post the question for 2 times to the microsoft newsgroups
web site, but it still come out all the ?. Something wrong with this web
site?
Here is my question again.
I got the difficulty to download a text file in netscape browser but
it's work in IE browser.
The netscape problem is the file download does not come out the
open/save dialog box, it straight display the text file content on the
web page. IE got no problem to display the open/save dialog box to let
people to choose from.
Here is the code :
sFileName = "a.txt"
sFilePath= "C:\" & sFileName
set f=fso.GetFile(sFilePath)
sFileSize = f.size
Const adTypeBinary = 1
Response.Clear
Set objStream = server.CreateObject ("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile sFilePath
Response.AddHeader "Content-Disposition", "attachment; filename=" &
sFileName
Response.AddHeader "Content-Length", sFileSize
Response.Charset = "UTF-8"
Response.ContentType = "text/plain"
Response.BinaryWrite objStream.Read
Response.Flush()
objStream.Close
Set objStream = Nothing
So how do make the script work in the netscape browser?
Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!