ASP:ASP页面的文件下载执行来自它代替 [英] ASP : File download of ASP page comes instead of executing it

查看:157
本文介绍了ASP:ASP页面的文件下载执行来自它代替的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP页面,这将创造从SQL查询创下了一个纪录,并使用通过使用Response.ContentType =应用程序/ vnd.ms - Excel的属性被设置为Excel页面。

I have an ASP page which will create a record set from an SQL query and create an excel page using that by using Response.ContentType = "application/vnd.ms-excel" property being set.

在执行该文件,它会显示一个保存(无论文件名我Response.AddHeader提到)对话框Excel文件为

When executing the file,it will show a save dialog for an excel file (whatever filename i have mentioned in Response.AddHeader) as

Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName

从服务器中运行时(我检查只能在IE),它的显示我一个对话框的打开,保存ASP文件本身,如果我给保存,它显示错误这非常适用于当地。但像消息无法下载...

This works well in local .But when running from the server (i checked only in IE ),ITs showing me a dialog box to "OPen" "Save " the ASP file itself, IF i give Save , Its showing an error message like "Could not download ..."

不知道如何解决这个问题?

Any idea how to solve this ?

推荐答案

即使你说这工作正常的地方,必须有在code某些问题(或数据)。

Even when you say it works ok local, there must be some problem in the code (or in the data).

尝试删除页眉和测试页面(服务器)

Try removing the header and testing the page (in the server)

这篇关于ASP:ASP页面的文件下载执行来自它代替的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆