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

<%@pagelanguage="java"import="java.util.*"pageEncoding="gbk"%><%Stringpath=request.ge... <%@ 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>
展开
 我来答
whatm22
2011-02-12 · TA获得超过228个赞
知道答主
回答量:198
采纳率:100%
帮助的人:148万
展开全部
我用你的代码测试了,全上去了,图片显示正确,可能是,你没有在webroot下面建upload这个文件夹吧
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式