(紧急求助)jsp 多组多文件上传问题

来源:百度知道 编辑:UC知道 时间:2024/07/05 12:04:40
求助关于多组多文件上传的问题
在我的测试页中,用了两个组,每组可以上传多个文件。仅在某一个组中上传多文件没有问题,现在两个组同时上传多个文件的时候,文件是传上去了,但是得不到第一组的文件名。
下面是我的代码:
一、上传页面
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" href="css/global.css" type="text/css">
</HEAD>
<script language=JavaScript>
function fAddAttach(m){
var gAttchHTML='<div class="tdtext"></div><div class="le"><input type="file" name="attachfile[]" class="box" size=40><input type="button" name="Submit" value="\u522a\u9664" class="box" id="btnDeleteReadAttach" /></div><span></span>';
var Attach=document.getElementById("dvReadAttach"+m);
var spnList=A

如果你的jsp应用了struts就方便得多了:
<html:form action="/contract.do" method="post"
enctype="multipart/form-data" >

<tr id="date_1">
<th>1:</th>
<td>
<html:file size="40" property="contractFile1" name="contractForm">
</html:file>
<img src="<%= request.getContextPath() %>/images/add_icon.gif" style="cursor:pointer;" onClick="addRowLevel()"/>
</td>
</tr>
<tr id="date_2" style="display:none;">
<th><bean:message key="per.contract.extraprotocal" />2:</th>
<td>
<html:file size="40" property="contractFile2" name="contractForm" ></html:file>
<img src="<%= request.getContextPath() %>/images/add_icon.gif" style="curs