从 java 中的请求获取所有文件路径

get all file path from request in java

<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>

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

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

谢谢你的时间。

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