!--#include file="upload.inc"-->
<% dim formsize,formdata If request.querystring("biaoti") <> "" then Dim conn,sql,rs,connstr set conn=server.createobject("adodb.connection") conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db1.mdb") set rs=server.createobject("adodb.recordset") sql="SELECT * From yuanchuang where (id is null)" rs.open sql,conn,1,3 rs.addnew rs("biaoti")=request.querystring("biaoti") If request.querystring("wenben") <> "" Then rs("wenben")=request.querystring("wenben") Else dim upload,file,formName,formPath,iCount,filename,fileExt set upload=new upload_5xSoft ''建立上传对象 formPath="pic" ''在目录后加(/) if right(formPath,1)<>"/" then formPath=formPath&"/" end if iCount=0 for each formName in upload.file ''列出所有上传了的文件''对象不是集合 set file=upload.file(formName) ''生成一个文件对象 ' if file.filesize<100 then 'response.write "<font size=2>请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>" 'response.end 'end if 'if file.filesize>70000 then 'response.write "<font size=2>图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>" 'response.end 'end if 'fileExt=lcase(right(file.filename,4)) ' if fileEXT<>".gif" and fileEXT<>".jpg" and fileEXT<>".swf" then ' response.write "<font size=2>文件格式不对 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>" ' response.end 'end if filename=file.FileName savefile=formPath+filename if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据 file.SaveAs Server.mappath(savefile) ''保存文件 'response.write"图片路径:" 'response.write"<input type=text name=bannerpath value="& ulpath &"flash/"& formPath&File.FileName&">" 'response.write" 请记清你上传的图片路径" end if rs("wenjian")="& formPath&File.FileName&" set file=nothing iCount=iCount+1 next set upload=nothing ''删除此对象 End If rs.update rs.close set rs=nothing conn.close set conn=nothing
Else Response.write"标题不能为空" response.end End If Response.write"上传成功" %> 程序运行中断帮看看哪错拉