A robust file upload system built with React and Node.js that handles large files by splitting them into smaller chunks for reliable uploads, progress tracking, and better error handling.
- ✅ Upload large files (tested with multi-GB files)
- ✅ Chunk-by-chunk upload with individual progress tracking
- ✅ Pause/resume upload functionality
- ✅ Real-time progress visualization
- ✅ Error handling with automatic retry options
- ✅ Responsive UI with Tailwind CSS
- ✅ File management with delete capabilities
- ✅ Upload speed monitoring
The project consists of two main parts:
- Frontend: React application with Vite
- Backend: Express.js server
large-file-upload/ ├── client/ # React frontend │ ├── package.json │ └── src/ │ ├── App.jsx │ └── components/ │ └── ChunkedFileUploader.jsx │ ├── backend/ # Express backend │ ├── package.json │ ├── server.js │ ├── uploads/ # Completed file storage (auto-created) │ └── chunks/ # Temporary chunk storage (auto-created)
- Node.js (v14 or newer)
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/large-file-upload.git cd large-file-upload - Install backend dependencies:
cd backend npm install - Install frontend dependencies:
cd ../client npm install
- Start the backend server:
cd backend node server.js
The server will run on http://localhost:5000
- In a new terminal, start the frontend development server:
cd client npm run dev
The app will run on http://localhost:3000
- POST /upload/start: Initialize an upload session
- POST /upload/chunk/:uploadId: Upload an individual chunk
- POST /upload/complete: Complete the upload and merge chunks
- GET /upload/status/:uploadId: Get upload progress
- GET /files: List all uploaded files
- DELETE /files/:fileName: Delete a specific file
You can customize various aspects of the upload process:
- Chunk Size: Modify the
CHUNK_SIZEconstant inChunkedFileUploader.jsx(default: 5MB) - Server URL: Change the
SERVER_URLconstant if your backend is running on a different address