我有几个 HTML 文件上传。
<label for="app_snapshot_image_1">SNAPSHOT_1</label>
<input type="file" name="app_snapshot_image_1" id="app_snapshot_image_1" />
<label for="app_snapshot_image_2">SNAPSHOT_2</label>
<input type="file" name="app_snapshot_image_2" id="app_snapshot_image_2" />
<label for="app_snapshot_image_2">SNAPSHOT_3</label>
<input type="file" name="app_snapshot_image_3" id="app_snapshot_image_3" />
这是处理来自WEB的多部分请求的spring控制器。
@RequestMapping(value="/apps/addOrModify/", method=RequestMethod.POST)
public String testUpload(
@RequestParam(required=false) MultipartFile app_snapshot_image_1,
@RequestParam(required=false) MultipartFile app_snapshot_image_2,
@RequestParam(required=false) MultipartFile app_snapshot_image_3) {
...
}
但是上面的控制器只能处理名为app_snapshot_image_1到3的3个文件;但这不是我想要的。我想使用控制器处理无限的文件。
希望你能理解我的问题,并为我的小英语感到抱歉。