同志们有个问题请教一下,顺路的都过来看看

junloveyan 2010-10-22 10:38:22
我有个网站上面提供了下载功能,但是通过迅雷下载,能够点击确定下载,
就是没有进度,多上几分钟提示资源连接失败,大家都发表一下意见看那看怎么回事
...全文
90 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
frankrenping 2010-10-23
  • 打赏
  • 举报
回复
应该是服务器的问题。
lionz1023 2010-10-22
  • 打赏
  • 举报
回复
你直接下载看看能下载完不,好多服务器都对大文件和下载工具有限制,很多人下载会消耗服务器资源的
never exists 2010-10-22
  • 打赏
  • 举报
回复
服务器的问题?每天回帖即可获得10分可用分
xhdong123 2010-10-22
  • 打赏
  • 举报
回复
通过IE可以下载是吧?试下这个
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn/conn.asp" -->
<html>
<head>
<title>文件管理_文件下载!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
-->
</style>
</head>
<body>
<%call downloadFile(replace(replace(Request("class"),"\",""),"/","")) '调用过程
Function downloadFile(Filename)
Filepath =server.MapPath("downloadfile")&"\"& Filename
Response.Buffer = True
Response.Clear
'创建Stream对象
Set Objstream = Server.CreateObject("ADODB.Stream")
Objstream.Open
'数据类型为二进制
Objstream.Type = 1
on error resume next
'检查文件是否出错
Set Objfile = Server.CreateObject("Scripting.FileSystemObject")
if not Objfile.FileExists(Filepath) then %>
<table width="553" height="234" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="553" valign="top"><table width="83%" height="214" border="0" align="center" cellpadding="-2" cellspacing="-2">
<tr>
<td height="91" style="font-size:12px;">
<% Response.Write("错误提示:<p>" & Filepath & " 不存在!<p>") %>
</td>
</tr>
<tr>
<td><div align="center"><br>
<input name="myclose" type="button" class="Style_button_del" id="myclose"
value="返回" onClick="javascrip:window.location.href='index.asp'">
</div></td>
</tr>
</table>
</td>
</tr>
</table>
<%
Response.End()
end if
'获取文件的大小
Set myfile = Objfile.GetFile(Filepath)
intFilelength = myfile.size
Objstream.LoadFromFile(Filepath)
if err then %>
<table width="553" height="244" border="0" cellpadding="-2" cellspacing="-2">
<tr>
<td width="510" height="244" valign="top"><table width="83%" height="189" border="0" align="center" cellpadding="-2" cellspacing="-2">
<tr>
<td height="91" style="font-size:12px;">
<% Response.Write("错误提示:<p> " & err.Description & "<p>") %>
</td>
</tr>
<tr>
<td height="98"><div align="center">
<br>
<input name="myclose" type="button" class="Style_button_del"
id="myclose" value="返回" onClick="avascrip:window.location.href='../index.asp'">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
<%
Response.End
end if
Response.AddHeader "Content-Disposition", "attachment; filename=" & myfile.name
Response.AddHeader "Content-Length", intFilelength
Response.CharSet = "UTF-8" '设置编码格式
Response.ContentType = "application/octet-stream"
Response.BinaryWrite Objstream.Read '向HTTP输出写入二进制信息
Response.Flush '将缓冲信息发送给浏览器
Objstream.Close
Set Objstream = Nothing
End Function
%>
</body>
</html>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧