Skip to main content

What is S3M?

S3M is a Laravel package that enables multipart uploads to AWS S3, allowing you to upload large files that exceed the standard 5GB single PUT request limit. It’s specifically designed for modern serverless environments where local filesystem storage is unreliable.

Why S3M?

When running applications in serverless environments, you face unique challenges:

Serverless Storage

You can never be sure that the same serverless container will be used on subsequent requests, making local filesystem storage unreliable.

5GB Upload Limit

AWS S3’s single PUT request has a 5GB limit. S3M splits large files into smaller parts and uploads them in parallel.

Direct Browser Uploads

Upload files directly from the browser to S3 without routing through your server, reducing server load and bandwidth costs.

Cloud-First Architecture

All files are stored in cloud storage (AWS S3) or shared filesystems (AWS EFS) from the start, following cloud-native best practices.

Key Features

1

Large File Support

Upload files that exceed the 5GB limit by automatically splitting them into smaller chunks.
2

Parallel Uploads

Upload multiple file parts simultaneously for faster transfer speeds.
3

Automatic Retries

Failed uploads are automatically retried with configurable retry attempts.
4

Configurable Settings

Customize chunk size, parallel upload count, and retry attempts to match your needs.
5

Authorization Checks

Built-in authorization system ensures only authorized users can upload files.
6

Flexible Configuration

Control bucket selection, visibility, and folder structure through configuration.

How It Works

S3M implements the AWS S3 multipart upload protocol with a streamlined workflow:
1

Initialize Upload

The browser requests an upload ID from your Laravel application.
2

Get Presigned URLs

Your application generates presigned URLs for each file part.
3

Upload Parts

The browser uploads file chunks directly to S3 using presigned URLs in parallel.
4

Complete Upload

After all parts are uploaded, your application marks the upload as complete.

Use Cases

Perfect for Laravel applications deployed on AWS Lambda, Google Cloud Functions, or other serverless platforms where local storage is ephemeral.
Handle video files, high-resolution images, and large datasets that exceed standard upload limits.
Reduce server bandwidth and processing by allowing browsers to upload directly to S3.
Build applications that store all files in cloud storage from day one, avoiding migration challenges later.
S3M is inspired by Laravel Vapor and follows similar architecture patterns for file uploads.

What’s Next?

Installation

Install S3M via Composer and configure your environment

Quickstart

Get up and running with your first multipart upload

Build docs developers (and LLMs) love