【急】关于文件上传,百思不得其解
齊麟 2010-09-16 02:30:38 页面①中有:
<input type="button" value="上传文件" onclick="uploadData();"/>点击后跳转到上传页面②,js:
/**
* 上传数据(页面跳转)
*/
function uploadData(){
var indexTypeName = "<%=request.getParameter("indexTypeName")%>";
window.location = "<%=path %>/maew/monitor/maintainMaew/upLoadData.jsp?indiType=1&indexTypeName="+indexTypeName;
}
页面②中:
<form action="" method="post" enctype="multipart/form-data" id="uploadForm" name="uploadForm" onsubmit="return checkUploadForm();">
<input type="file" name="indiDataFile" id="indiDataFile" />
<input type="submit" name="button2" id="button2" value="上传" />
</form>
但是奇怪的是:当鼠标放在上传文件的页面②的上传按钮上面时,浏览器状态栏显示的路径居然是页面①跳转到页面②时的路径"<%=path %>/maew/monitor/maintainMaew/upLoadData.jsp?indiType=1&indexTypeName="+indexTypeName;,
点击该按钮只能会刷新该页面②,无法实现上传等操作。