📁 Dropbox File Upload API I

Upload and share files easily

1 hour
easy
3 submissions

Project Overview

Upload and share files easily

The Dropbox File Upload API is a simplified file management system that mimics basic Dropbox functionality. It allows users to upload files, view a list of their uploaded files, download them using a unique ID, and delete them when no longer needed. This project is a great way to learn how to handle file storage, multipart uploads, and RESTful route design in a backend API.

Your submissions

No submissions yet, start by making your first submission

Detailed Project Description

📁 Dropbox File Upload API

Build a simple Dropbox-like file upload service that allows users to upload, list, download, and delete files using a RESTful API.

🧠 Project Description

Your task is to implement an API that allows users to:

  • Upload files via multipart/form-data
  • Retrieve a list of uploaded files
  • Download a specific file by its ID
  • Delete uploaded files by ID

This API should handle edge cases like large files, invalid MIME types, missing files, and invalid IDs.


📦 API Endpoints

POST /api/files/upload

Upload a file to the server.

  • Content-Type: multipart/form-data
  • Body Parameters:
    • file: The file to upload (required)
  • Success Response (201):
    { "fileId": "string", "filename": "string", "size": 12345, "mimeType": "text/plain", "createdAt": "2025-04-06T12:00:00Z" }

📂 GET /api/files

List all uploaded files for the current user.

  • Success Response (200):
    [ { "fileId": "string", "filename": "string", "size": 12345, "mimeType": "image/png", "createdAt": "2025-04-06T12:00:00Z" } ]

📥 GET /api/files/:fileId

Download a file by its ID.

  • Path Parameter: fileId (string)
  • Success Response (200):
    • Content-Type: application/octet-stream
    • Body: Raw file stream

🗑️ DELETE /api/files/:fileId

Delete a file by its ID.

  • Path Parameter: fileId (string)
  • Success Response (200):
    { "message": "File deleted successfully" }

Project Completion Criteria

  • Uploading valid, empty, invalid, and large files
  • Listing uploaded files
  • Downloading files by valid, invalid, or deleted IDs
  • Deleting files and confirming their removal
  • Proper error handling and status codes