那是IE的功能吧,如.exe|.zip之类的文件,它自然会出现下载提示窗口。
解决方案 »
- 跪求好人帮忙搭建php开发环境!
- wamp Access denied for user ''@'localhost' to database 'newsdb'
- 如何写一个</p>的表达式,并在preg_split()中使用哪个
- 使用有中文的usb-key做双向ssl认证时遇到500错误
- 一个很简单的问题
- 想知道blog的相关技术都是什么
- 如何知道一个字符在字符串中是否存在?
- 怎样获得一个出生日期最小的人的名字
- 要把空格存入数据库该怎么办啊???
- 为什么我file()一个19行的文件,却出来了21行?(两行空行)
- 哪位DX知道PHP如何链接FTP服务器,并且能让用户登录到自己主目录下?
- 我有个文本输入框,里面打了大约有5000个汉字,当我发布时,怎么得到它的大小?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<%
'filename="/dxsck/文字测试/全新版大学英语综合教程1/test1.da"
filename="/dxsck/aa.lg"
'filename="/dxsck/听读资料/全新版大学英语综合教程1/第一册/unit1/1.wlg"
call downloadFile(filename)
Function downloadFile(strFile)
' make sure you are on the latest MDAC version for this to work
' -------------------------------------------------------------
' get full path of specified file
strFilename = server.MapPath(strFile)
' clear the buffer
Response.Buffer = True
Response.Clear
' create stream
Set s = Server.CreateObject("ADODB.Stream")
s.Open
' Set as binary
s.Type = 1
' load in the file
on error resume next
' check the file exists
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FileExists(strFilename) then
Response.Write("<h1>Error:</h1>" & strFilename & " 文件不存在<p>")
Response.End
end if
' get length of file
Set f = fso.GetFile(strFilename)
intFilelength = f.size
s.LoadFromFile(strFilename)
if err then
Response.Write("<h1>Error:</h1>文件下载错误<p>")
Response.End
end if
' send the headers to the users browser
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
Response.AddHeader "Content-Length", intFilelength
Response.CharSet = "gb2312"
Response.ContentType = "application/octet-stream"
' output the file to the browser
Response.BinaryWrite s.Read
Response.Flush
' tidy up
s.Close
Set s = Nothing
End Function
%>
</body>
</html>