I am looking for an example of using Ajax to upload multiple files in Play java framework.
This is the HTML form:
<form>
<input type="file" id="multiplefiles" multiple required>
<button type="submit" id="button">Upload</button>
</form>
And this is the only thing I found in Play documentation:
public static Result upload() {
File file = request().body().asRaw().asFile();
return ok("File uploaded");
}
I don't know how to send the files via Ajax and how to split them in Play.
BTW, I was able to do it via the form action.