【发布时间】:2015-08-04 21:13:57
【问题描述】:
我现在想获取文件路径时遇到问题。这是我的代码:
public void service(HttpServletRequest request, HttpServletResponse res)
throws ServletException, IOException {
String cabArch = req.getParameter("fRutaArch");
String rutaArch = getFileName(filePart);
}
在jsp中我有这个:
<td align="left" class="e2">
<input type="file" name="fRutaArch" id="fRutaArch" title="Seleccionar archivo">
</td>
<td>
<button type="submit" name="bCargar" id="bCargar">Cargar</button>
</td>
我只需要完整的文件路径,请指教?
【问题讨论】:
-
我认为您实际上不希望客户端上的文件路径(通常这是不可能的),而是将文件上传到 servlet。因此,您可能会发现 this post 很有趣
-
实际上,我一直在寻找一个不可能的解决方案 xD 无论如何谢谢,我会尝试用另一种方式来处理我的 porpuse