Skip to content

Repository files navigation

BlobService – AWS S3 File Upload Service

A scalable ASP.NET Core service for uploading, storing, and managing files using AWS S3 cloud storage.

This service is designed to support media handling for backend systems such as chat applications, messaging platforms, and content management systems.


Highlights

  • Built using ASP.NET Core Web API
  • AWS S3 Cloud Storage Integration
  • Secure File Upload Handling
  • Media URL Generation
  • Reusable Backend Utility Service
  • Environment-based Configuration

Features

File Upload

  • Upload images and files to AWS S3
  • Generate accessible file URLs
  • Support multiple file types

Cloud Storage Integration

  • AWS S3 Bucket Integration
  • Secure credential configuration
  • Scalable cloud-based file handling

API Support

  • RESTful upload endpoint
  • Easy integration with other backend services
  • Media support for real-time chat systems

Security

  • File validation before upload
  • Environment variable based secret management
  • Secure AWS credential handling

Upload Flow

Client → API Endpoint → BlobService → AWS S3 Bucket → File URL Response


Architecture

This project follows a clean service-based architecture:

Controller → Service → AWS S3

Layer Responsibilities

Controllers

  • Handle HTTP requests and responses

Services

  • Manage file upload logic and AWS S3 interaction

AWS S3

  • Stores uploaded media securely in cloud storage

Technology Stack

Backend

  • ASP.NET Core Web API
  • C#

Cloud

  • AWS S3

Tools & Concepts

  • Dependency Injection
  • REST APIs
  • Cloud Storage
  • Environment Configuration

API Endpoint

Upload File

Method Endpoint Description
POST Blob/files/upload Upload image/file to AWS S3

Example Request

Request

POST Blob/files/upload
Content-Type: multipart/form-data

Response

{
  "success": true,
  "message": "Files uploaded successfully",
  "data": {
    "totalFiles": 1,
    "messages": [
      {
        "messageId": "12345",
        "FilePath": "uploads/2026/05/image.png",
        "FileUrl": "https://bucket.s3.amazonaws.com/image.png",
        "FileDownloadUrl": "https://bucket.s3.amazonaws.com/image.png?download=true",
        "originalFileName": "image.png",
        "fileType": "image",
        "contentType": "image/png",
        "fileSizeBytes": 102400
      }
    ]
  }
}

Installation

1. Clone Repository

git clone https://github.com/keyu04/BlobService.git
cd BlobService

2. Restore Dependencies

dotnet restore

3. Configure AWS Credentials

Update AWS configuration inside appsettings.Production.json:

{
  "AWS": {
    "BucketName": "your-bucket-name",
    "AccessKey": "YOUR_ACCESS_KEY",
    "SecretKey": "YOUR_SECRET_KEY",
    "Region": "your-region"
  }
}

4. Run Application

dotnet run

Future Improvements

  • File size validation
  • Image compression
  • Pre-signed URL support
  • Multiple bucket support
  • Docker containerization

Use Cases

  • Chat applications
  • Messaging platforms
  • User profile image upload
  • Document management systems
  • Media storage services

Getting Started

Prerequisites

  • .NET SDK 8.0 or higher
  • AWS Account
  • AWS S3 Bucket
  • Visual Studio 2022 / VS Code

Author

Developed by Keyur Halpati
GitHub: https://github.com/keyu04

About

AWS S3 File Upload Service built using ASP.NET Core Web API

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages