下面是别人做的多个文件上传的客户端部分代码,不是Struts,但方法不错。<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body>
<script language="javascript">
function DoUpload() {
var PID=(new Date()).getTime() % 1000000000;
if (document.fmupload.showprogress.checked) {
window.open("ul_fathbar.asp?PID=" + PID,PID, "height=100,width=400,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no");
}
document.fmupload.action = "ul_fath.asp?a=upload&PID=" + PID;
document.fmupload.submit();
}
</script>
<Dir><form enctype=multipart/form-data name=fmupload Method=POST><h3>Upload files</h3><font size=1>Root folder: 20MB Free</font><br><input type=file name=file1 size=35 Class=FormItem><br><input type=file name=file2 size=35 Class=FormItem><br><input type=file name=file3 size=35 Class=FormItem><br><input type=file name=file4 size=35 Class=FormItem><br><input type=file name=file5 size=35 Class=FormItem><br><input type=file name=file6 size=35 Class=FormItem><br><input type=CHECKBOX name=showprogress><font size=1>Show progress bar</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=ul_fath.asp?n=7><font size=1>Add field</font></a><br><br><input type='button' value= 'Cancel' onclick='history.go(-1)'; Class=FormItem> <INPUT type=submit name=m value=Upload OnClick='DoUpload()' Class=FormItem></form></body></html>