欢迎光临
我们一直在努力

给你一个全的.

建站超值云服务器,限时71元/月

<%
response.buffer = true
dim strfilepath, strfilesize, strfilename

const adtypebinary = 1

strfilepath = request.querystring("file")
strfilesize = request.querystring("size")
strfilename = request.querystring("name")

response.clear

8*******************************8
requires mdac 2.5 to be stable
i recommend mdac 2.6 or 2.7
8*******************************8
set objstream = server.createobject("adodb.stream")
objstream.open
objstream.type = adtypebinary
objstream.loadfromfile strfilepath

strfiletype = lcase(right(strfilename, 4))
    
     feel free to add your own content-types here
    select case strfiletype
        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 ".asp"
            contenttype = "text/asp"
        case else
            handle all other files
            contenttype = "application/octet-stream"
    end select
    
    
    response.addheader "content-disposition", "attachment; filename=000" & strfilename
    response.addheader "content-length", strfilesize
     in a perfect world, your client would also have utf-8 as the default
     in their browser
    response.charset = "utf-8"
    response.contenttype = contenttype
    
    response.binarywrite objstream.read
    response.flush

objstream.close
set objstream = nothing

%>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 给你一个全的.
分享到: 更多 (0)

相关推荐

  • 暂无文章