在 IE7 中使用 Server.CreateObject(“ADODB.Stream”)
我有一个 ASP.NET 1.1 应用程序,它使用以下代码在响应中写出一个文件:
Dim objStream As Object
objStream = Server.CreateObject("ADODB.Stream")
objStream.open()
objStream.type = 1
objStream.loadfromfile(localfile)
Response.BinaryWrite(objStream.read)
此代码由显示此文件或在 Internet Explorer 中提供打开/保存对话框的弹出窗口调用。 问题是,它在 IE6 中似乎工作正常,但在 IE7 中,弹出窗口打开然后关闭,而不显示文件。 有谁知道出了什么问题吗?
I have an ASP.NET 1.1 application that uses the following code to write out a file in the 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 pop up window that displays this file or gives a open/save dialog in Internet Explorer. The problem is, that it seems to work fine in IE6 but in IE7 the pop up opens and then closes without displaying the file. Any one know whats wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一个这样的代码,用于从服务器下载文件:
如果适合您的情况,请尝试。
I have a code like this for download files from server:
Try if work in your case.
因此,Asp.Net 提供的图像是 tiff 文件。 这里说 IE7 不显示 4 个字母的文件由于某种原因进行扩展。 我想我会尝试将其更改为 3 个字母,看看会发生什么。
So the images that are being served by Asp.Net are tiff files. And it says here that IE7 doesn't display files with 4 letter extensions for some reason. I think I'll try to change it to 3 letters and see what happens.