AWS S3 / R2 Storage

Generate pre-signed S3/R2 upload and download URLs with MIME validation.

1|Updated May 2, 2026
One-click install
npx skills add https://github.com/Levironexe/architect --skill aws-s3-r2-storage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: AWS S3 / R2 Storage
Source: https://github.com/Levironexe/architect/tree/main/skills/patterns/s3-storage
Command: npx skills add https://github.com/Levironexe/architect --skill aws-s3-r2-storage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common risk and complexity of handling user file uploads by preventing large or unsafe file bytes from passing through your server while still giving your browser a secure way to upload and download objects.

Core Features & Use Cases

  • Pre-signed direct uploads (PUT): Generate time-limited pre-signed URLs so clients can upload straight to S3/R2 without your backend receiving the file bytes.
  • Secure pre-signed downloads (GET): Produce time-limited signed download URLs on demand while storing only the object key in your database.
  • Safety guardrails: Validate MIME types before signing, confirm uploaded objects exist after upload, and centralize the S3 client singleton to avoid unsafe configuration patterns.
  • Use case: You want users to upload profile images (or attachments) from a web app, store only the object key, and serve expiring download links securely even if your bucket/CDN setup changes.

Quick Start

Configure your S3/R2 bucket and allowed MIME types, then ask your coding agent to implement direct browser uploads with pre-signed PUT URLs and server-side confirmation that stores only the S3 object key in your database.

Frequently Asked Questions about AWS S3 / R2 Storage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable direct browser uploads to S3 without routing file bytes through my server?

Secure pre-signed downloads generate time-limited GET URLs on demand using only the stored object key. This grants clients expiring access to retrieve S3 objects safely without exposing your bucket permanently or routing downloads through the server.

Does this pre-signed URL workflow work with Cloudflare R2 or only AWS S3?

This workflow works with both AWS S3 and S3-compatible R2 by centralizing a singleton S3 client. You can safely switch or combine storage providers while maintaining the same pre-signed URL upload and download logic.

How do I generate pre-signed download URLs for S3 objects using only the database key?

On-demand signed download URLs are generated using the object key stored in your database. This allows your web app to serve secure, expiring retrieval links without needing to persist full file paths or public bucket URLs.

How do I validate file types before generating a pre-signed URL for direct S3 uploads?

Server-side allowlist validation checks the declared MIME type before signing the pre-signed PUT URL. This prevents clients from uploading unauthorized file formats directly to your S3 or R2 bucket.