【问题标题】:get all file path from request in java从java中的请求中获取所有文件路径
【发布时间】:2017-01-15 11:47:19
【问题描述】:
<html lang="en">
<head>
    <title>File Upload</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
    <form method="POST" action="upload" enctype="multipart/form-data" >
        File:
        <input type="file" name="file" id="file" /> <br/>
        Destination:
        <input type="text" value="/tmp" name="destination"/>
        </br>
        <input type="submit" value="Upload" name="upload" id="upload" />
    </form>
</body>

我想获取通过浏览器选择的所有文件路径(input type="file") 将其上传到 ftp 服务器。

我找到了很多代码快照,但只是它们给了我文件名,我需要绝对路径,例如“c:\users\filename”。

感谢您的宝贵时间。

【问题讨论】:

    标签: java file-upload inputstream absolute-path input-type-file


    【解决方案1】:

    出于安全原因,浏览器不会为您提供任何文件的完整/绝对路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-16
      • 2014-10-16
      • 1970-01-01
      相关资源
      最近更新 更多