在我的asp页面中,我必须通过java脚本在IE中打开一个csv文件.我使用的代码如下:
csvWindow = window.open("/com/csv/"+csvFileName, "datacsv", "toolbar=yes,location=no,directories=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=790,height=450,screenX=50,screenY=25,left=50,top=25");
代码在IIS服务器中运行.
当我运行此代码并打开csv文件时,它会给出以下消息
Microsoft Office Excel cannot access the file
"http://192.168.3.228:107/com/csv/CSV_file_1345728.csv". There are several possible reasons:
The file name or path does not exist
the file is being used by another program
the workbook you are trying yo save has the same name as a currently open workbook.
但文件正在创建.所以路径是正确的,我认为该文件也没有被其他程序使用
请帮帮我,我该怎么办
问题是,当Excel打开时,它将尝试自己获取CSV文件,这是自2007年以来Office应用程序中的行为发生变化.但是,由于Excel在不同的进程中运行,因此它不会发送任何在此期间生成的cookie.登录.当网站收到请求时,它将以401状态响应.
我知道没有简单的解决方案,结果令人满意.这里有许多解决方案,但都有缺点.
| 归档时间: |
|
| 查看次数: |
2801 次 |
| 最近记录: |