各位大虾 小的想问 Action如何才能得到 jsp页面上传框里的路径,比如我想上传桌面上的一个图片,我想在Action里得到C:\Users\Administrator\Desktop\31.jpg 这个路径!该怎么写啊?
<tr>
<td align="right">
附件:
</td>
<td id="more" align="left">
<s:file name="file"></s:file>
</td>
</tr>
试了它里面好多方法都不行!getAbsolutePath() 、、、getPath()、、、、、都不行啊!有什么办法?

解决方案 »

  1.   

    看看这个.
    http://home.pocketgo.com.cn/space-54-do-blog-id-3992.html
      

  2.   

    我现在想要做一个邮件服务 发送附件 并且是可以发多个附件 想要在Action中得到客户端的绝对路径,有什么好办法啊?
      

  3.   


    <script    language="JavaScript">   
    function    getFilePaht()   
    {     
         document.form1.FilePath1.value    =    document.form1.up_file.PostedFile.FileName     

    </script>   
    <input    id="up_file"    onmouseout ="getFilePath()"    style="WIDTH:    232px;    HEIGHT:    22px"    type="file"    size="19"    name="up_file">   
    <input    type="hidden"    name="FilePath1"    id="FilePath1"    runat="server"> 
     就这样,在action中get就行了