{"id":15100936,"url":"https://github.com/subhashchandra-birajdar/uploadfile-image","last_synced_at":"2026-01-06T09:33:35.882Z","repository":{"id":254046278,"uuid":"845324764","full_name":"Subhashchandra-Birajdar/UploadFile-image","owner":"Subhashchandra-Birajdar","description":"File Storage and Retrieval API is a Spring Boot application designed to facilitate file management through a RESTful API. This project provides a comprehensive solution for storing, retrieving, and downloading files both from a database and a file system.","archived":false,"fork":false,"pushed_at":"2024-08-21T04:07:59.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T13:48:53.106Z","etag":null,"topics":["jpa-hibernate","logging","multipart-formdata","multipart-uploads","mysql-database","postgresql","slf4j-loggers","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Subhashchandra-Birajdar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-21T03:07:53.000Z","updated_at":"2024-08-21T04:49:31.000Z","dependencies_parsed_at":"2024-08-21T06:15:22.012Z","dependency_job_id":null,"html_url":"https://github.com/Subhashchandra-Birajdar/UploadFile-image","commit_stats":null,"previous_names":["subhashchandra-birajdar/uploadfile-image"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2FUploadFile-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2FUploadFile-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2FUploadFile-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2FUploadFile-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Subhashchandra-Birajdar","download_url":"https://codeload.github.com/Subhashchandra-Birajdar/UploadFile-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858878,"owners_count":20684057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jpa-hibernate","logging","multipart-formdata","multipart-uploads","mysql-database","postgresql","slf4j-loggers","spring-boot"],"created_at":"2024-09-25T18:03:54.940Z","updated_at":"2026-01-06T09:33:35.831Z","avatar_url":"https://github.com/Subhashchandra-Birajdar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Project Title - File Storage and Retrieval API\n\n## Overview\n\nThis project is a Spring Boot application that provides a RESTful API for storing, retrieving, and managing files. \nIt supports storing files in both a database and the file system. The API includes endpoints for uploading files, retrieving files, and downloading files from the file system.\n\n## Features\n\n- Upload files to the database and file system.\n- Retrieve all files with metadata (name, type, and access URL).\n- Download files by name from the file system.\n- Supports cross-origin requests.\n\n## Technologies Used\n\n- **Java 17**\n- **Spring Boot**\n- **Spring Data JPA**\n- **Hibernate**\n- **MySQL or PostgreSQL**\n- **Maven**\n- **Lombok**\n- **SLF4J** for logging\n\n## Getting Started\n\n### Prerequisites\n\n- **Java 17** or later installed\n- **Maven** installed\n- **MySQL** or **PostgreSQL** database setup\n\n### Setup Instructions\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/Subhashchandra-Birajdar/UploadFile-image.git\n   cd UploadFile-image\n   \n2. **Configure the database:**\n\nOpen the src/main/resources/application.properties (or application.yml) file and configure your database connection.\n\nproperties\n```\nspring.datasource.url=jdbc:postgresql://localhost:5432/your-database-name\nspring.datasource.username=your-username\nspring.datasource.password=your-password\nspring.jpa.hibernate.ddl-auto=update\n```\n\n# File storage location\nfile.storage.path=C:\\\\path\\\\to\\\\your\\\\file\\\\storage\\\\directory\\\\\n\n# Start the application:\nThe application will start on http://localhost:8080\n\n\n# API Endpoints\n\n### Upload File\n- **URL:** `/api/uploadFilesIntoDB`\n- **Method:** `POST`\n- **Description:** Upload a file to the database and file system.\n- **Request:**\n  - `file` (multipart/form-data): The file to be uploaded.\n- **Response:**\n  - `200 OK` with a success message.\n#### Example in Screenshot:\n![upload Image](https://github.com/user-attachments/assets/1b24c87f-821f-4b6d-b300-d32044ad1789)\n\n### Get All Files With Image Response\n- **URL:** `/api/files`\n- **Method:** `GET`\n- **Description:** Retrieve a list of all files with their metadata.\n- **Response:**\n  - `200 OK` with a list of files (name, type, URL).\n#### Example in Screenshot:\n![Get All Images](https://github.com/user-attachments/assets/88c65d25-df40-4b63-83aa-35501ad370b2)\n\n### Download File from File System\n- **URL:** `/api/getFilesFromFileSystem/{fileName}`\n- **Method:** `GET`\n- **Description:** Download a file from the file system by its name.\n- **Path Parameter:**\n  - `fileName`: The name of the file to download.\n- **Response:**\n  - `200 OK` with the file's binary data.\n#### Example in Screenshot:\n![Get - Download Image](https://github.com/user-attachments/assets/8b66c8c1-49a5-4e10-a130-c40aa1b2ce24)\n\n\n## API Reference\n\n#### Upload File\n\n```http\n  POST /api/uploadFilesIntoDB\n```\n\n| Parameter | Type     | Description                |\n| :-------- | :------- | :------------------------- |\n| 'file' | `multipart/form-data` | Required. The file to be uploaded. |  \n\n#### Get all images\n\n```http\n  GET /api/files\n```\n\n| Parameter | Type     | Description                |\n| :-------- | :------- | :------------------------- |\n| 'none' | `string` | **Required**.Retrieves a list of all files with metadata. |\n\n#### Get image by name\n\n```http\n  GET /api/getFilesFromFileSystem/{fileName}\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `id`      | `string` | **Required**. image of name to fetch |\n\n\n## Project Structure\n- **`src/main/java/com/jts/entity/Files.java`:** The entity class representing the files stored in the database.\n- **`src/main/java/com/jts/repository/FileRepository.java`:** The repository interface for accessing file data.\n- **`src/main/java/com/jts/service/FilesService.java`:** The service layer handling file operations.\n- **`src/main/java/com/jts/controller/FilesController.java`:** The REST controller exposing the API endpoints.\n\n## Logging\nThis project uses **SLF4J** with **Logback** for logging. Logs are written to the console during application execution.\nThe `FilesController` and `FilesService` classes include log statements to track the flow of operations.\n\n## Contributing\nIf you'd like to contribute to this project, feel free to fork the repository and submit a pull request. Issues and feature requests are also welcome!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhashchandra-birajdar%2Fuploadfile-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubhashchandra-birajdar%2Fuploadfile-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhashchandra-birajdar%2Fuploadfile-image/lists"}