如何在jsp中上传文件时获取文件路径?

时间:2012-11-14 06:33:26

标签: jsp

在这里我面临一个问题,就像我在jsp上传文件一样,我无法读取完整的文件路径。我只获取文件名.Below是我的代码

  <td align="left">File Path  :
  <input type="file" id="biometricFile_Path" name="biometricFile_Path" /> 
  <span id="uploadsId" class="errorText" >&nbsp; 


    

像这样读取文件路径..

String fileName=request.getParameter("biometricFile_Path");

假设我上传的文件路径为“C:\ Users \ apanigrahi \ Desktop \ test.xls”   但是我通过请求对象获取值时只得到test.xls。

1 个答案:

答案 0 :(得分:0)

据我所知,基于安全限制,您无法在服务器端获得完整路径名。但是某些版本的IE提供了完整的路径。

相关问题