在 ie8 上通过 asp 打开 csv 文件时出现问题?
从我的 asp 应用程序中,我尝试在 ie8 上打开一个 csv 文件。不过,相同的代码在 ie6 上运行良好。下面是代码:
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
ContentType = "application/msexcel"
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Response.AddHeader "Content-Length", strFileSize
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
请帮助我理解我哪里出错了。
From my asp application, i am trying to open a csv file onto ie8. The same code is working fine on ie6 although. Below is the code:
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
ContentType = "application/msexcel"
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Response.AddHeader "Content-Length", strFileSize
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Please help me undestand where i am going wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该问题现已解决。文件大小设置为 50,这在 IE6 上运行良好。在 IE8 上运行相同的代码会减少数据。我将此处的文件大小增加到 800,并将所有数据放入 Excel 中。不确定 IE6 和 IE8 如何解释文件大小。
This issue is resolved now. The Filesize was set to 50 which somehow worked fine on IE6. The same code when ran against IE8 trimmed down the data. I increased the file size here to 800 and got all the data onto the excel. Not sure how IE6 and IE8 interprets the file size.