A Spring Boot project with file upload functionality to both local storage and a database.
To run this project, you will need to have Java 17.
1 ) Download your project from this link shown below
git clone https://github.com/Eukolos/spring-file-upload.git
2 ) Go to the project's home directory shown below
cd spring-file-upload
3 ) Create native image though this command shown below
mvn spring-boot:run
POST /db-upload
Accept: multipart/form-data
Content-Type: multipart/form-data
{
example.pdf
}
RESPONSE: HTTP 200 (OK)
Response-Type: String
Location header: http://localhost:8080/db-upload
POST /local-upload
Accept: multipart/form-data
Content-Type: multipart/form-data
{
example.pdf
}
RESPONSE: HTTP 200 (OK)
Response-Type: String
Location header: http://localhost:8080/local-upload
Get /db-download?name=example.pdf
RESPONSE: HTTP 200 (OK)
Response-Type: multipart/form-data
Location header: http://localhost:8080/db-download?name=example.pdf
Get /local-download?name=example.pdf
RESPONSE: HTTP 200 (OK)
Response-Type: multipart/form-data
Location header: http://localhost:8080/local-download?name=example.pdf
This project was created by Eukolos. Contributions are welcome!