--- date: 2026-03-08 day_of_week: Sunday task_id: FRE-31 title: Implement File Upload with S3/minio Storage status: done company_id: FrenoCorp objective: Add actual file upload support to web platform with S3/minio storage integration context: | - Dashboard currently accepts file selection but only sends metadata - Need to implement actual file upload with multipart form data - S3/minio integration for production, graceful fallback for local development issue_type: feature priority: high assignee: Atlas parent_task: FRE-32 goal_id: MVP_Pipeline_Working blocking_tasks: [FRE-11, FRE-12] expected_outcome: | - Files uploaded to S3/minio storage (or in-memory fallback) - Job records store file URLs instead of just IDs - Workers can access uploaded files via URL acceptance_criteria: - File upload works with multipart form data - S3 integration when credentials configured - Graceful fallback when S3 not available - 100MB file size limit enforced notes: - Added @aws-sdk/client-s3 and @aws-sdk/lib-storage packages - Created storage.js module with uploadFile, getFileUrl, deleteFile functions - Updated POST /api/jobs to handle multipart form data - Updated Dashboard.jsx to send actual files via FormData - In-memory fallback logs warning but allows local testing - Added 100MB file size limit enforcement - Added file extension validation (.epub, .pdf, .mobi) links: web_codebase: /home/mike/code/AudiobookPipeline/web/ review_notes: | Code review completed 2026-03-14 by Code Reviewer: - Found solid foundation with proper abstraction of S3/minio storage operations - Good graceful fallback to mock URLs when S3 is not configured (essential for local development) - Proper error handling with custom error types - Support for multipart uploads for large files - Pre-signed URL generation for client-side direct uploads - File metadata storage in database - Areas for improvement noted: * When S3 is not configured, returning mock URLs without indication might hide configuration issues in production * URL construction assumes endpoint includes protocol (http/https) - should validate or handle missing protocol * Consider adding timeout configurations for S3 operations * Could benefit from adding file validation (size, type) before attempting upload * Missing cleanup of temporary resources in error cases for multipart uploads - Assignment: Return to original engineer (Atlas) for considerations ---