
jsp 中获取 <input type = file id ="filePath" name= "filePath"> 的路径
在jsp中通过<%Stringpath=request.getParameter("filePath");//结果为null%>...
在jsp中通过 <% String path = request.getParameter("filePath"); //结果为null%>
展开
1个回答
2013-07-11
展开全部
我测了,这段代码是可以的,你检查一下是不是其他问题,顺便提示一下获取路径以后最好做一下编码格式转化,避免出现乱码!String path = request.getParameter("filePath"); //上传目标地址
if(path!=null&&!path.equals("")){
strUp = new String(paht.getBytes("ISO-8859-1"), "GB2312");
}
if(path!=null&&!path.equals("")){
strUp = new String(paht.getBytes("ISO-8859-1"), "GB2312");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询