Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/callicoder/spring-boot-file-upload-download-rest-api-example
Spring Boot File Upload / Download Rest API Example
https://github.com/callicoder/spring-boot-file-upload-download-rest-api-example
file-download file-upload rest spring spring-boot spring-mvc
Last synced: 29 days ago
JSON representation
Spring Boot File Upload / Download Rest API Example
- Host: GitHub
- URL: https://github.com/callicoder/spring-boot-file-upload-download-rest-api-example
- Owner: callicoder
- Created: 2018-04-11T14:04:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-13T17:02:37.000Z (about 3 years ago)
- Last Synced: 2024-09-29T08:21:47.051Z (about 1 month ago)
- Topics: file-download, file-upload, rest, spring, spring-boot, spring-mvc
- Language: Java
- Homepage: https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/
- Size: 63.5 KB
- Stars: 408
- Watchers: 26
- Forks: 324
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## Spring Boot File Upload / Download Rest API Example
**Tutorial**: [Uploading an Downloading files with Spring Boot](https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/)
## Steps to Setup
**1. Clone the repository**
```bash
git clone https://github.com/callicoder/spring-boot-file-upload-download-rest-api-example.git
```**2. Specify the file uploads directory**
Open `src/main/resources/application.properties` file and change the property `file.upload-dir` to the path where you want the uploaded files to be stored.
```
file.upload-dir=/Users/callicoder/uploads
```**2. Run the app using maven**
```bash
cd spring-boot-file-upload-download-rest-api-example
mvn spring-boot:run
```That's it! The application can be accessed at `http://localhost:8080`.
You may also package the application in the form of a jar and then run the jar file like so -
```bash
mvn clean package
java -jar target/file-demo-0.0.1-SNAPSHOT.jar
```