日期:2014-05-16  浏览次数:20467 次

关于才能弹出保存文件的对话框,就是右键另存为那种
<a     href= "ftp://192.168.1.3/xxx.mov "> 保存下载 </a>
希望做到点击这个链接就能弹出对话框,可是现在却弹出一个网页,里面嵌入quicktime播放器了
请问应该如何解决?谢谢

------解决方案--------------------
http://community.csdn.net/Expert/TopicView3.asp?id=5386405

看看这个帖子,你就会了
------解决方案--------------------
<a href= "download.asp?n=1.wmv&upname=1.wmv "> download </a>

把1.wmv换成你想要提供下载的文件名就可以了

download.asp:


<%
Response.Buffer=true
Response.Clear

dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
'*********************************************调用时传入的下载文件名
Dname=trim(request( "n "))
upname=trim(request( "upname "))
'******************************************************************
If Dname <> " " Then
'******************************下载文件存放的服务端目录
url=server.MapPath( ". ")& "\ "&Dname

'***************************************************
End If

Set fso=Server.CreateObject( "Scripting.FileSystemObject ")
Set fl=fso.getfile(url)
flsize=fl.size
flName=fl.name
Set fl=Nothing
Set fso=Nothing
%>
<%
Set objStream = Server.CreateObject( "ADODB.Stream ")
objStream.Open
objStream.Type=1
objStream.LoadFromFile url


Select Case lcase(Right(flName, 4))
Case ".asf "
ContentType= "video/x-ms-asf "
Case ".avi "
ContentType= "video/avi "
Case ".doc "
ContentType= "application/msword "
Case ".zip "
ContentType= "application/zip "
Case ".xls "
ContentType= "application/vnd.ms-excel "
Case ".gif "
ContentType= "image/gif "
Case ".jpg ", "jpeg "
ContentType= "image/jpeg "
Case ".wav "
ContentType= "audio/wav "
Case ".mp3 "
ContentType= "audio/mpeg3 "
Case ".mpg ", "mpeg "
ContentType= "video/mpeg "
Case ".rtf "
ContentType= "application/rtf "
Case ".htm ", "html "
ContentType= "text/html "
Case ".txt "
ContentType= "text/plain "
Case Else
ContentType= "application/octet-stream "
End Select



Response.AddHeader "Content-Disposition ", "attachment; filename= " & upname
Response.AddHeader "Content-Length ", flsize

Response.Charset= "UTF-8 "
Response.ContentType= ContentType

Response.BinaryWri