{
  "id": 20502506,
  "title": "Next.js Server Action Presigned Uploads — Private Storage, Browser Direct and Signed URLs",
  "url": "https://urgent.news/2026/11/17/next-js-server-action-presigned-uploads-private-storage-browser",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-17T22:06:13.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/dorianvale91583/nextjs-server-action-presigned-uploads-private-storage-browser-direct-and-signed-urls-e65"
  },
  "original_language": "en",
  "account": "The article discusses a method for securely uploading private reports in a marketplace using Next.js server actions. When a customer needs to upload a report, the Next.js server creates a short-lived presigned upload URL and sends the browser directly to a private storage bucket. This approach keeps the storage backend private while allowing the customer to upload the report without streaming bytes through Next.js.\n\nThe process involves picking a storage backend after testing tenant isolation, rather than counting SDK methods. The article recommends Amazon S3, Cloudflare R2, or Supabase Storage, depending on specific needs. It suggests testing S3-compatible backends with Infrai, which acts as a signer leg for a plain REST contract.\n\nThe testing process involves creating two tenants and two users, with one malicious tenant trying to access another tenant's report. The goal is to ensure that the server denies cross-tenant requests before interacting with storage for a URL. The server then checks if an expired read link can retrieve the object, verifying that the database remains the source of truth for ownership and searchable fields.\n\nThe article provides a minimal Next.js action that uses Infrai's storage presign route as one leg of the experiment. The action authenticates the session, generates a random key, and requests a presigned write URL from the storage backend. After a successful upload, the key is recorded in the database. The browser then uploads the file directly to the presigned URL, without the browser ever seeing the API key. The article emphasizes testing for cross-tenant access control, time-bound read links, and ensuring that retries cannot create duplicate database records. If these criteria are met, the chosen storage backend is considered suitable for the marketplace's private upload requirements.",
  "summary": "Short answer: for a marketplace that serves private reports, let a Next.js server action mint a short-lived presigned upload URL, send the browser straight to a private bucket, and mint a separate signed read URL when the customer downloads. Pick the storage backend by testing tenant isolation, not by counting SDK methods. The request path is small: browser asks your app for an upload session;…",
  "key_points": [
    "Next.js server actions create presigned upload URLs for private storage.",
    "Browser uploads files directly to storage without streaming bytes.",
    "Amazon S3, Cloudflare R2, and Supabase Storage tested for tenant isolation."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}