Skip to content

A lightweight and secure API for uploading, downloading, and streaming files with built-in validations for file types, size, and content. Perfect for integrating into web apps and admin panels.

Notifications You must be signed in to change notification settings

eslam-eltayar/file-manager-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ ASP.NET Core File Management API

A simple and secure file management system built with ASP.NET Core Web API. It provides endpoints for uploading, downloading, and streaming files with built-in validations.


πŸš€ Features

  • βœ… Upload single file
  • βœ… Upload image with validation
  • βœ… Upload multiple files
  • βœ… Download files by ID
  • βœ… Stream files efficiently

πŸ”’ File Validations

  • βœ… Validate file name, size, and content
  • ❌ Block executable files using file signature (magic number)
  • πŸ–ΌοΈ Allow only specific image extensions (e.g. .jpg, .png, .webp)

πŸ› οΈ Tech Stack

  • ASP.NET Core Web API
  • Entity Framework Core
  • FileStream / MemoryStream
  • SQL Server (or any EF-supported DB)

πŸ“¦ How to Run

  1. Clone the repository:

    git clone https://github.com/your-username/your-repo-name.git
  2. Navigate to the project folder:

    cd your-repo-name
  3. Run the project:

    dotnet run
  4. Access the API (with Swagger if enabled) at:

    https://localhost:{port}/swagger
    

πŸ“‚ Sample Endpoints

Endpoint Method Description
/api/files/upload POST Upload a single file
/api/files/upload-image POST Upload image only
/api/files/upload-many POST Upload multiple files
/api/files/download/{id} GET Download file by ID
/api/files/stream/{id} GET Stream file by ID

Feel free to contribute or fork the repo for your own use!

About

A lightweight and secure API for uploading, downloading, and streaming files with built-in validations for file types, size, and content. Perfect for integrating into web apps and admin panels.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages