word| Browser | download <%
Response.buffer=true
Get the file you want to download, if not empty. On the download
Dim Url,trueurl
Url= "Download file path and download filename"
Fname=request ("filename")
If fname<> "" Then
Trueurlurl=server. MapPath ("/") &url
End If
Set Objfso=server. CreateObject ("Scripting.FileSystemObject")
Set Fn=objfso.getfile (Trueurl)
Flsize=fn.size
Flname=fn.name
Set fn=nothing
Set objfso=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. " ASP ",". ASA "," ASPX "," ASAX ",". MDB "
Response.Write "protected file, cannot download."
Response.End
Case Else
Contenttype= "Appliation/octet-stream"
End Select
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.