求教关于vb网页问题,希望各位前辈给解决下,小弟谢了。

血鹏枫叶 发布于 2013/05/19 17:00
阅读 134
收藏 0

图片上传的页面,总是提示:

Microsoft VBScript 运行时错误

错误 '800a0035'

文件未找到

/upload.asp,行
37

 

代码大致如下:

<br><br>
<img src="PIC/upload.gif" width="149" height="36"> <br>
请选择您要上载的图片:<form action="" method="post">
<input name="f1" type="file"  >
<input name="t1" type="submit" value="click" >
</form>
<%
dim a ,b,c,d

a=request("f1")
for i=1 to len(a)
b=mid(a,len(a)-i+1,1)
if b="\" then
exit for
end if
c=b+c
next

%>
<%
if a<>"" then
set fs=server.CreateObject("scripting.filesystemobject")
s1=a
t1=server.mappath("upload/"&c)
fs.copyfile s1,t1                                              <!--第37行-->
dim rs,rs1
set rs=dbconn.execute("select * from upload where imgname='"&c&"'")
if rs.eof then
set rs1=dbconn.execute("insert into upload(snum,imgname) values('"&snum&"','"&c&"')")
%>
您要上载的文件:<%=a%><br>
<br>
<br>
<%="成功上载文件:"&c%>
<%
else
%>

 



 

 

 

加载中
0
jingshishengxu
jingshishengxu

<form action="" enctype="multipart/form-data" method="POST">

这样子试一试呢?

0
血鹏枫叶
血鹏枫叶
您好,我改了那句,是不出现原来提示的那个了,但是不会执行后面的代码了,点了上传以后,就刷新页面了,没提示上传图片,上传不上去,
0
血鹏枫叶
血鹏枫叶

您好,我看了下下面的代码也找不出问题,我给您发过去全部代码,还得麻烦你看下。谢谢您了。

<html>
<!--#include file="conn/conndata.asp"-->
<head>
<title>
图片上传
</title>
</head>
<%
snum=session("snum")
check snum
headtop
%>
<br><br>
<img src="PIC/upload.gif" width="149" height="36"> <br>
请选择您要上载的图片:<form action="" enctype="multipart/form-data" method="POST">
<input name="f1" type="file"  >
<input name="t1" type="submit" value="上传" >
</form>
<%
dim a ,b,c,d

a=request("f1")
for i=1 to len(a)
b=mid(a,len(a)-i+1,1)
if b="\" then
exit for
end if
c=b+c
next

%>
<%
if a<>"" then
set fs=server.CreateObject("scripting.filesystemobject")
s1=a
t1=server.mappath("upload/"&c) 
fs.copyfile s1,t1
dim rs,rs1
set rs=dbconn.execute("select * from upload where imgname='"&c&"'")
if rs.eof then
set rs1=dbconn.execute("insert into upload(snum,imgname) values('"&snum&"','"&c&"')")
%>
您要上载的文件:<%=a%><br>
<br>
<br>
<%="成功上载文件:"&c%>
<%
else
%>
<br>
<br>
您要上传的文件名重复,请重新命名再上传!
<%
end if
end if
%>

<table width="800" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>图片显示</td>
  </tr>
  <tr>
    <td><table width="800" height="53" border="1" cellpadding="1" cellspacing="1">
        <%
dim  rs3,intnum,strsnum,strimgname,sql,linenum,tline
sql="select * from upload order by uptime"
set rs3=server.createobject("ADODB.Recordset")

rs3.open sql,dbconn,3,2

rs3.pagesize=5
linenum=1
tline=rs3.pagecount
dim sname

%>
        <%
for i=1 to tline
%>
        <tr>
<%
rs3.absolutepage=i
for recordnums=1 to 5
%>
          <td width="160"  height="100"> <a href=<%="upload/"&rs3("imgname")%> target="_blank"><img src=<%="upload/"&rs3("imgname")%> width="80" height="80" >
            </a> <br>
   <%=rs3("imgname")%>
    </td>
<%
rs3.movenext
if rs3.eof then
exit for
end if
next
%>
</tr>
<%next%>
      </table></td>
  </tr>
</table>
</body></html>

 

返回顶部
顶部