Using Server.CreateObject ("ADODB.Stream") in IE7
I have an ASP.NET 1.1 application that uses the following code to write a file in response:
Dim objStream As Object
objStream = Server.CreateObject("ADODB.Stream")
objStream.open()
objStream.type = 1
objStream.loadfromfile(localfile)
Response.BinaryWrite(objStream.read)
This code is called by a popup window that displays this file, or it opens an open / save dialog in Internet Explorer. The problem is that it works fine in IE6, but in IE7 the popup opens and then closes without showing the file. Does anyone know what is wrong?
+1
source to share
2 answers
I have code like this to download files from the server:
strFilename = Server.MapPath("/App_Upload/" & strFilename)
With Response
.AddHeader("Content-Type", "binary/octet-stream")
.AddHeader("Content-Disposition", "attachment; filename=" & strFilename & ";")
.WriteFile(strFilename)
.End()
End With
Try to work for your case.
0
source to share