'下面是test.htm
1<html>
2<head>
3<title>Untitled Document</title>
4</head>
5<body <form="" action="addpro.asp" enctype="multipart/form-data" method="post" name="form1">
6<input name="image" type="file"/>
7<input name="subimage" type="file"/>
8<input name="Submit" type="submit" value="Submit"/>
9
10</body>
11</html>
''''''''''''''''''''''''''''''''''''''''''
'下面是addpro.asp
1 @LANGUAGE="VBScript" TRANSACTION=Required
1
2if Request.Form("image")="" or Request.Form("subimage")="" then Response.Redirect("test.htm")
3
4set upl = Server.CreateObject ("SoftArtisans.FileUp")
5up1.path=server.MapPath("images/")
6
7upl.Form("image").Save
8upl.Form("subimage").Save
9
10Response.Write("ok")
11
12
'''''''''''''''''''''''''''''''
问题是,为什么选择文件并且提交以后,怎么都不能到Response.Write("ok")这句,ie的navigation进度总是100%,就是不刷新页面。
还有个问题,就是怎样销毁upl对象?
set up1=nothing就可以?
---------------------------------------------------------------
set up1=nothing
你这样看看:
1
2
3
4set upl = Server.CreateObject ("SoftArtisans.FileUp")
5if up1.Form("image")="" or up1.Form("subimage")="" then Response.Redirect("test.htm")
6up1.path=server.MapPath("images/")
7
8upl.Form("image").Save
9upl.Form("subimage").Save
10
11Response.Write("ok")
12
13
---------------------------------------------------------------
你的页面代码有错,请注意看以下
1<html>
2<head>
3<title>Untitled Document</title>
4</head>
5<body <form="" action="addpro.asp" enctype="multipart/form-data" method="post" name="form1">
6<input name="image" type="file"/>
7<input name="subimage" type="file"/>
8<input name="Submit" type="submit" value="Submit"/>
9
10</body>
11</html>
有没有看到,你的"<body" 少了一个右尖括号,这导致了提交按钮失效。
另外,应用上传组件,request.form这样的语句是不能再用了,你想要判断是否有上传文件,必须用该组件里面的出错判断来进行。
加一个尖括号之后,程序可以正常运行