Upload Multiple Files with Spring Boot 1.5.10, Java 8, and Angular 5

This post shows working code fragments that upload multiple files from a web browser.

Angular 5

The web UI uses Angular 5. This is a fragment of the package.json file.

Component HTML

The HTML file for the component

Component TS

In this code fragment, we append data to formData twice using the same name ‘document’. All files are grouped under that name.

Spring Boot 1.5.11

In our backend application, we specify one parameter of type List<MultipartFile>.

Sample debugging: