ASP隐藏下载地址
<%
Response.Buffer = true
Response.Clear
dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
Dim strFileName
strFileName=replace(replace(Request("file"),"\",""),"/","") '传参
strFileName="/files/"&strFileName ' 改成你你文件的存放路径
If strFileName<>"" Then
'******************************下载文件存放的服务端目录
url=Server.MapPath(strFileName)
else
Response.Write("no found")
Response.end
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 ".bmp"
ContentType = "image/bmp"
Case ".ppt"
ContentType = "application/vnd.ms-powerpoint"
Case ".mdb"
ContentType = "application/x-msaccess"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html" ,"htm(1)"
ContentType = "text/html"
Case ".txt"
ContentType = "text/plain"
Case Else
ContentType = "application/octet-stream"
End Select
' 我是用UPload组件上传的,如果重名会产生"(数字)" 后缀,
' 有些主机会阻止下载这类文件,所以这里加一个检查,将Upload组件自动生成的后缀
If InStr(lcase(Right(flName, 1)),")") Then
flName=mid(flName,1,Len(flName)-3)
End If
Response.AddHeader "Content-Disposition", "attachment; filename=" &
相关文档:
<%
for i=1 to rs.recordCount '变量i从1循环到数据库中的全部记录数
if (i mod 1 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr align='center'>"
end if
%>
此处为要循环的内容
<%if (i mod 1 = 0) then ......
原文链接:http://www.iwapr.cn/article/daima/30.html
ASP/Visual Basic代码
<%
dim picurl,all_picurl
'皆是全局变量:分别定义图片的链接地址;所有指定文件夹(包括指定文件夹的子文件夹下图片url地址)
picurl="" &n ......
<%Dim connstrconnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Stu.mdb")
Set bb = Server.CreateObject("ADODB.Connection")
bb.Open connstr%>
<html>
<head>
<meta http-equiv="content-Language" content="zh-cn" />
<meta http-equiv="Content-Type ......
ASP系列函数大全-网上收集的一些ASP函数及表达式
ASP函数
大全
ASP函数与VBSCRIPT类似,以下举一些常用的函数
Array()
函数返回一个数组
表达式 Array(list)
允许数据类型: 字符,数字均可
实例: <%
Dim
myArray()
For i = 1 to 7
Redim Preser ......
Dim FilePath,FileName
Set ObjFileStream = Server.CreateObject("ADODB.Stream")
ObjFileStream.Type = 1
ObjFileStream.Mode = 3
ObjFileStream.open
ObjFileStream.LoadfromFile FilePath&"\"&FileName&".doc"
ObjFileStream.Position = 0
response.binarywrite  ......