我在书上抄了个例子,运行后就是不能上传文件:
代码:
upload.jsp<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>
<body>
<p>&nbsp;</p>
<p align="center">上传文件选择</p>
<form method="post" action="do_upload.jsp" enctype="nultipart/form-data">
<table width="75%" align="center">
<tr>
<td><input type="file" name="file1" size="30"></td>
</tr>
<tr>
<td><input type="file" name="file2" size="30"></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="上传">
</td>
</tr>
</table>
</form>
</body>
do_upload.jsp<%@ page contentType="text/html;charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %>
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>
<body>
<% 
com.jspsmart.upload.SmartUpload su =new com.jspsmart.upload.SmartUpload(); su.initialize(pageContext);
su.service(request,response);
su.setTotalMaxFileSize(500000);
su.upload();
int count=su.save("upload/");
out.println(count+"个文件上传成功!<br>");
 %>
 </body>
 </html>
</html>我把jspsmartUpload放在了C:\Tomcat 5.0\common\lib\下!
但是都是不能上传(count值为0),何解!个位帮帮忙!