急急急急急急!如何在浏览器里不直接打开EXCEL,而是提示保存?
一般,如果对于一个服务器端的EXCEL文件,当在浏览器里打开对应连接时,默认是直接在IE里调用EXCEL打开,而我想直接提示另存为,各位大侠,有和高招???
Thanks!
Thanks,griefforyou !
搞定,代码是:
<% Dim strFilePathConst
adTypeBinary = 1
strFilePath = "text/test.xls"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile Server.MapPath(strFilePath) 'change the path if necessary
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=留言--"&date()&".xls"
'如果文件名固定,那就直接filename=文件名.doc,这个名字就是用户选“保存”时,出现的名字
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing '写完,释放对象 %>
请问把文件夹打包成压缩包怎么写?
我想连网站的图片也可以打包下载~!!
[此贴子已经被作者于2005-5-28 15:53:33编辑过]