I am trying to upload multiple files in one request. My code is as follows:
<form action="/application/overviewsubmit" method="POST" enctype="multipart/form-data">
<input type="file" name="files">
<input type="file" name="files">
<input type="submit" value="Run...">
</form>
And the controller:
public static void overviewSubmit(List<File> files){
System.out.println(files);
}
If both files are installed by the user, it works. But if the user selects only one of them and leaves the other untouched, the files are always zero.
source
share