Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有 Vert.x 的 Java 客户端-服务器应用程序。客户端将文件发送到服务器,服务器获取的是 HttpServer 请求。我需要将此文件保存在服务器上。
如何从请求中获取输入流?
不确定这是否是您想要的:既然您可以获得 HttpServerrequest 的实例,为什么不添加一个 uploadHandler,就像 Vert.x 文档中的以下代码一样?
request.uploadHandler { upload -> upload.streamToFileSystem "uploads/${upload.filename()}" }
这样,您也可以将文件保存在服务器上。