This is a Spring Boot application that demonstrates how to upload files to a MySQL database using Spring Data JPA. It includes a RESTful API for file uploads, database storage, and retrieval.
Before running this project, ensure you have the following prerequisites installed:
- Java JDK
- Maven
- MySQL database server
- Spring Boot
Follow these steps to get the project up and running:
-
Clone the repository:
git clone https://github.com/swapniltake1/multiple-file-uplod-service.git cd multiple-file-uplod-service
-
Configure the database settings in
src/main/resources/application.properties
:spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name spring.datasource.username=your_database_username spring.datasource.password=your_database_password spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.hibernate.ddl-auto=update
-
Build and run the project:
mvn spring-boot:run
-
Access the application at
http://localhost:8080
in your web browser.
- Upload files by making a POST request to
/upload-files
. Use thefiles
parameter in the request to send one or more files. - Retrieve uploaded files and their details using appropriate API endpoints.
POST /upload-files
: Upload one or more files.GET /files
: Retrieve a list of uploaded files.GET /files/{id}
: Retrieve a specific uploaded file by ID.GET /files/{id}/download
: Download a specific uploaded file.
- Java
- Spring Boot
- Spring Data JPA
- MySQL
- Maven
This project is licensed under the MIT License - see the LICENSE file for details.