求助,有关文件下载?

无爱大叔 2005-11-14 03:55:19
我做了一个网站,里面需要下载的文件格式都是opz格式的。opz是一种电子图书的格式。
现在,我把opz格式的图书上传到远程服务器对应的目录下面,在前台页面居然不能下载,提示:无法找到该页。
如果把这个opz格式的文件弄成rar格式的就可以下载,在本机调试程序的时候可以下载。
网上http://www.chip.cn/ebook/free200404.html页面的opz图书也可以下载,这是怎么回事?

是不是服务器端的iis需要设置?
...全文
130 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
无爱大叔 2005-11-28
  • 打赏
  • 举报
回复
有什么办法不设置IIS也能下载opz图书呢?
我在网上找到了这样的代码,依然不行。
<%
Response.Buffer = true
Response.Clear

dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
'*********************************************调用时传入的下载文件名
Dname=trim(request("n"))
'******************************************************************
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=" & flName
Response.AddHeader "Content-Length", flsize

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

Response.BinaryWrite objStream.Read
Response.Flush
response.Clear()
objStream.Close
Set objStream = Nothing

%>
patchclass 2005-11-14
  • 打赏
  • 举报
回复
一般来说对于未知的文件后缀,IIS会提供下载,但是 好像II6不是这样的,你可以检查下 IIS里面的配置,看看 应用程序映射 里面的配置
无爱大叔 2005-11-14
  • 打赏
  • 举报
回复
我不知道服务器是2003还是2000
意思就是远程的opz格式的文件不能下载,本地的可以下载。我用ftp传的文件。

而http://www.chip.cn/ebook/free200404.html网站的opz格式可以直接下载,我不明白
yousite1 2005-11-14
  • 打赏
  • 举报
回复
还有一种可能就是我理解错了你的原义了.你再解释一下问题
yousite1 2005-11-14
  • 打赏
  • 举报
回复
你的系统估计是2003的吧?
文件类型那边看看,
iis那边.
若白师妹 2005-11-14
  • 打赏
  • 举报
回复
想不出来

28,406

社区成员

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

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