文件上传问题, jspSmartUpload我的问题在哪?
fggph 2006-08-15 01:03:19 我的程序本意是:上传一个文件(xls),然后把存在服务器上的路径返回来。
我用的是jsp SmartUpload组件,我只需要上传一个文件,不需要多个文件
我的程序如下,就是上传不了,不知道问题出哪里!帮我看看,指点指点,谢谢了
/////////////////////////上传页面/////ind_data.jsp////////////////////////////
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
<title>编码导入</title>
</head>
<script language="javascript">
function SubmitCheck(){
var filePath = exportForm.filePath.value;
var xlsName = (filePath.substr(filePath.lastIndexOf(".")+1)).toUpperCase();
if (xlsName!="XLS"){
alert("请选择导出的Excel文件!");
exportForm.filePath.focus();
return false;
}
exportForm.submit();
}
</script>
<body class="bodyStyle">
<p class="curpos">当前位置是:导入编码数据</p>
<form method="post" ENCTYPE="multipart/form-data" action="do_import_data.jsp" name="exportForm" >
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC" class="blue">
<tr class="normalTable">
<td class="codedesc" align="right" width="29%">当前导入的数据表:</td>
<td class="codedesc" width="71%>table_xls</td>
<input type="hidden" name="tablename" value="table_xls">
</tr>
<tr class="normalTable">
<td class="codedesc" align="right" width="29%">导入文件路径:</td>
<td class="codedesc" width="71%">
<input type="file" name="filePath" size="50" ></td>
</tr>
<tr class="normalTable">
<td height="71" colspan="2" align="center">
<input name="importData" type="button" onClick="SubmitCheck()" class="normalbtn" value="导入数据">
<input type="button" class="normalbtn" onclick="javascript:location.href='in_data.jsp'" value="取消">
</td>
</tr>
</table>
</form>
</body>
</html>
////////////////////////上传处理页面//do_import_data.jsp/////////////////////////