Tags | spring-boot rest-api rest-templates |
Java is mostly used for backend application but sometimes you might need to harnes javascript skill within java to run some front application that does something that mostly is backend heavy, this is what we are going to do here
In this project we are going to upload a file from the frontend and process it in the backend
Create a spring boot application and add the relevant dependencies
spring-boot-starter-web
spring-boot-starter-thymeleaf
Create an UploadController
this will hold the rest request to handle the file upload UI, this controller should handle two request
uploadSingleFile
uploadMultipleFiles
Note: You need a place to upload these files, and this will be another folder in your machine, create that directory such that if it does not already exist a new folder will be created.
Now you have to build the UI element using thymeleaf that will handle the files upload process. The UI component should have
// File size: 50 MB
// Name of file: MyNewFile.pdf
// Total file size: 500 MB
// Totals files: 3