Uploading files to AWS S3 with Presigned URLs (Extended Version)
Introduction In my previous post, I showed you how to upload files to AWS S3 using presigned URLs. Today, we’re taking it a step further: creating a permanent file URL that doesn't expire. This is perfect for when you need to save a link to your database and use it anytime. There are two main ways to handle this: 1. Using only AWS S3 for storage and access Pros: Easy to set up; everything is managed within S3. Great for internal apps or dev environments where high security and performance aren't a priority yet. Cons: Inconsistent Speeds: If a user in London tries to access a bucket in Singapore, it will be slow. Security Risks: If your S3 link is leaked, someone could spam requests, costing you a lot of money. S3 isn't built to handle DDoS attacks. 2. Using S3 combined with CloudFront (CDN) Pros: Better User Experience: Website images load almost instantly because they are cached on servers worldwide. Lower Costs: CloudFront handles repeated requests so your S3 bucket does...