!!!我想自己写个无组件,写完了可是出错了麻烦各位看看
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'upload.file(...)'
/1/博客评论系统/admin/bkpx/ok.asp,行 11
ok.asp:
<!--#INCLUDE FILE="upload_5xsoft.inc"-->
<!-- #Include File="Conn.asp" -->
<%
Server.ScriptTimeOut=1000
%>
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
set upload=new upload_5xSoft
formPath="upload/"
zid=upload.form("zid")
set file=upload.file("file1") ''生成一个文件对象
if file.FileSize>0 then''如果 FileSize > 0 说明有文件数据
if file.filesize>3000000 then
response.write "文件过大"
response.end
end if
filename=file.filename
file.SaveAs Server.mappath(formPath&FileName) ''保存文件
end if
set file=nothing
set upload=nothing ''删除此对象
set rs=server.createobject("ADODB.recordset")
sql = "select * from plzt"
rs.Open sql,conn,1,3
if filename<>"" then
rs("filename")=filename
end if
rs.update
rs.close
set rs=nothing
set conn=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/css.css">
<title>旅行社系统</title>
</head>
<body bgcolor="#eeeeee" topmargin="5" leftmargin="5">
<center>
<table>
<tr>
<td>
<b>banner</b>
</td>
<form action="../right.asp" method="post" name="form1">
<td>
<input type="submit" value="返回">
</td>
</form>
</tr>
</table>
</center>
<br><br>
<center>修改成功<br><br>
附带文件<%response.write FileName %>上传成功
</center>
<%
end if
%>
</body>
</html>
pl_add.asp:
<td align="right">图片:</td>
<td align="left"> <input type="file" name="file1" size=30 ></td>