我在使用smartUpload组件上传文件下面是代码 打印“上传成功了,但是upload文件夹没有上传的文件,没提示

<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'imageUpLoad.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<form action="smartUpload.jsp" method="post" enctype="multipart/form-data">
请选择上传的文件<input type="file" name="pic">
<input type="submit" value="上传">
</form>
</body>
</html>

--------------
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="org.lxh.smart.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'smartUpLoad.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
SmartUpload smart=new SmartUpload();
smart.initialize(pageContext);//初始化上传操作
smart.upload(); //上传准备
try{
smart.save("/upload");
System.out.println("上传成功");
}
catch(Exception e){
out.println(e.getMessage());
}
%>
</body>
</html>
那个upload的包建在webroot下,打印了"上传成功",但是没有

这里有一个无刷新多文件上传系统
里面可以判断文件多少 文件类型
里面有教程和源码

参考资料:http://www.blueidea.com/common/shoutbox/redir.asp?4=n&id=11280

温馨提示:内容为网友见解,仅供参考
第1个回答  2011-02-12
我用你的代码测试了,全上去了,图片显示正确,可能是,你没有在webroot下面建upload这个文件夹吧
相似回答