文件上传代码,这段上传代码都不知道是我什么时候写的了,哈哈还是也拿出来吧,
<%
dim filename,filepath,filetype,obstream,fso,fod,sql'定义变量
filepath=request.Form("filename"'取得文件路径
if len(filepath)=0 or instr(filepath,"'"<>0 then'路径的合法性
response.Redirect("firstfile.asp?info=文件不合法"
else
filename=mid(filepath,instrrev(filepath,""+1)'取得文件名
filetype=mid(filename,instrrev(filename,"."+1)'取得文件类型
imagepath=server.mappath("image"
if instr(filetype,"jpg"<>0 or instr(filetype,"gif"<>0 or instr(filetype,"png"<>0 then'判断是否为我们要上传的文件
set fso=server.createobject("scripting.filesystemobject"
set fod=fso.getfolder(imagepath)
for each f in fod.files
f=mid(f,instrrev(f,""+1)
if f=filename then'判断文件是否存在
response.Redirect("firstfile.asp?info=文件己存在"
end if
next
set fso=nothing
set obstream=server.createobject("adodb.stream"
obstream.type=1
obstream.open
obstream.loadfromfile filepath
path="image"&filename
if obstream.size<500*1024 then
sql="select * from jimmy"
call opendb()
rs.open sql,cnn,1,3
rs.addnew
rs("image_path"=path
rs.update
call closedb()
obstream.savetofile server.mappath(path)'上传文件
response.Redirect("firstfile.asp?info=上传文件成功"
end if
obstream.close
set obstream=nothing
else
response.Redirect("firstfile.asp?info=文件不合法,必须是图片文件jpg,gif,png,"
end if
end if
%>
敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载像素火影骨架佐助 (Perseverance Fire Shadow)手机版v1.16
下载要塞英雄 安卓版v33.20.0-39082670-Android
下载梦想城镇vivo最新版本 安卓版v12.0.1
梦想城镇vivo版是这款卡通风模拟经营类手游的渠道服版本,玩
怦然心动的瞬间 安卓版v1.0
怦然心动的瞬间是一款真人向的恋爱互动游戏,在游戏中玩家将扮演
曼尼汉堡店游戏 安卓版v1.0.3
曼尼汉堡店是一款非常好玩的精品恐怖类型冒险游戏,在这款游戏中
现代总统模拟器去广告版 安卓版v1.0.46
现代总统模拟器是一款休闲养成类游戏,可能对于不少的玩家来说都
现代总统模拟器付费完整版 安卓版v1.0.46
现代总统模拟器高级版在商店是需要付费的,相对于普通版本,高级