jsp中怎么取得上传文件的路径和文件名
jsp 代码
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
</head>
<body>
<table align="center" class="fix_table">
<tr align="center">
<td class="long">
<form action="import.do" method="post"
enctype="multipart/form-data">
上传文件:
<input type="file" name="file1" id="file1"/>
<input type="submit" value="确定" />
</form>
</td>
</tr>
<tr>
<td>
<input type="button" value="获取上传文件" onclick="test();"/>
</td>
</tr>
</table>
</body>
<script type="text/javascript">
function test(){
var file=document.getElementById("file1").value;
alert(file);
}
</script>
</html>
修改浏览器设置
2016-01-11
for (int j = 0; j < nextheight*nextwidth; j++)
pTmpImage[j] = pDstData[j];
for (int j = 0; j < 3 * nextheight*nextwidth; j++)
pTmpImage[nextheight*nextwidth + j] = pSrcCoef[gap + j];
gap += 3 * nextheight*nextwidth;
}
}