s3

Presigned S3 upload URLs (AWS SDK v2)

When clients upload files directly to S3, your API avoids handling large payloads and you get better scalability. I generate a presigned PUT URL with a short expiry and a constrained object key prefix so users can’t overwrite arbitrary objects. The cr

ActiveStorage for file uploads and attachments

ActiveStorage handles file uploads with cloud storage integration. It supports local disk, S3, Google Cloud Storage, Azure. Files attach to models via has_one_attached and has_many_attached. I use ActiveStorage for avatars, documents, images. Image va

AWS S3 and CloudFront for static asset hosting

AWS S3 stores static assets with high durability and availability. Bucket policies control access with JSON policy documents. CloudFront CDN distributes assets globally with edge caching. Origin Access Control (OAC) restricts S3 access to CloudFront o

Pre-signed S3 upload from the browser

Large file uploads don’t belong on app servers. My default is: the server issues a short-lived pre-signed URL, the browser uploads directly to S3, then the server stores the object key. That keeps latency low and costs predictable. Before signing, I v

Laravel file storage with disk abstraction

Laravel's filesystem abstraction treats local, S3, FTP, and other storage identically. I configure disks in config/filesystems.php with drivers and credentials. The Storage facade provides methods like put(), get(), delete() that work across all disks