Kotlin SpringBoot Upload/Download File - MultipartFile + Thymeleaf + Bootstrap 4 example
In the tutorial, we will show you how to build a SpringBoot web-application to upload/download file with Thymeleaf engine and Bootstrap 4 using Kotlin language.
Technologies
- Java 8
- Maven 3.6.1
- Spring Tool Suite: Version 3.9.4.RELEASE
- Spring Boot: 2.0.2.RELEASE
- Bootstrap 4
- Kotlin - Version: 1.2.41
Goal
We create a SpringBoot project as below:
-> Upload Form:
-> Download Form:
Practice
We create a SpringBoot project with below dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
Frontend
Upload Multipart-Form
– Create /templates/multipartfile/uploadform.html file:
Read more at:
Kotlin SpringBoot Upload/Download File - MultipartFile + Thymeleaf + Bootstrap 4 example
Top comments (0)