我通过 Java Spring 中的 http post 接收了一个多部分文件。我想将该请求和文件转发到其他服务器。我怎样才能在 Spring java 中做到这一点?
最佳答案
在您的 jsp 文件中:
<form ... method="post" enctype="multipart/form-data">
在你的 Controller 类中:
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public Long save(@RequestParam("file") MultipartFile file,
@RequestParam String fileCode,...) throws IOException {
...
}
关于java - 如何使用 Java Spring 将上传文件的多部分/表单数据表单重新发送到不同的服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33444995/