实现代码
Table
<table id="importFileTab" border="0" width="40%" bgcolor="#ffffff"
cellspacing="0" cellpadding="0">
<TR >
<TD nowrap align="left" bgcolor="#e4e4e4">附件列表</TD>
<TD nowrap align="right" bgcolor="#e4e4e4">
<a href="#" onclick="javascript:insertTr()">新增附件</a>
</TD>
</TR>
<input type="hidden" name="attachFileIds" value="">
<TR style="height: 25px;">
<TD nowrap align="left">
<input name="ImportFile" id="ImportFile" size="50" type="file" class="button" >
</TD>
<TD nowrap><a href="#" onclick="javascript:deleteTr(this)">删除附件</a></TD>
</TR>
</table>
新增附件JS代码
删除附件JS
2.后台Java接收文件
文件获取
后续操作listFile进行文件上传即可