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


Thus, the images served by Asp.Net are tiff files. And he says here that for some reason IE7 does not display files with 4 letter extensions. I think I'll try to change it to 3 letters and see what happens.



-1


source







All Articles