各位大虾 小的想问 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()、、、、、都不行啊!有什么办法?
<tr>
<td align="right">
附件:
</td>
<td id="more" align="left">
<s:file name="file"></s:file>
</td>
</tr>
试了它里面好多方法都不行!getAbsolutePath() 、、、getPath()、、、、、都不行啊!有什么办法?
http://home.pocketgo.com.cn/space-54-do-blog-id-3992.html
<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就行了