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.
- β Upload single file
- β Upload image with validation
- β Upload multiple files
- β Download files by ID
- β Stream files efficiently
- β Validate file name, size, and content
- β Block executable files using file signature (magic number)
- πΌοΈ Allow only specific image extensions (e.g.
.jpg
,.png
,.webp
)
- ASP.NET Core Web API
- Entity Framework Core
- FileStream / MemoryStream
- SQL Server (or any EF-supported DB)
-
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
-
Navigate to the project folder:
cd your-repo-name
-
Run the project:
dotnet run
-
Access the API (with Swagger if enabled) at:
https://localhost:{port}/swagger
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!