<%dim upload,file,formName,formPath,iCount,Photo_Beizhu,upcountset upload=new upload_5xSoft ''建立上传对象response.write upload.Version&"" ''显示上传类的版本if upload.form("filepath")="" then ''得到上传目录 HtmEnd "请输入要上传至的目录!" set upload=nothing response.endelse formPath=upload.form("filepath") ''在目录后加(/) if right(formPath,1)<>"/" then formPath=formPath&"/" end ifdim rs,sqlset rs=server.createobject("adodb.recordset") sql="select * from 表名"rs.open sql,conn,1,3iCount=0for each formName in upload.file ''列出所有上传了的文件 set file=upload.file(formName) ''生成一个文件对象 if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据 file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件'录入数据库 rs.addnew rs("字段")=formPath&File.FileName rs.update response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!" iCount=iCount+1 end if set file=nothingnextset upload=nothing ''删除此对象Htmend iCount&" 个文件上传结束!"sub HtmEnd(Msg) set upload=nothing response.write ""&Msg&" [返回]"end sub%>