serverpod-file-uploads

Generate and verify server-side file uploads for Serverpod storage backends.

3.2k|369|Updated May 22, 2021
One-click install
npx skills add https://github.com/serverpod/serverpod --skill serverpod-file-uploads
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serverpod-file-uploads
Source: https://github.com/serverpod/serverpod/tree/main/packages/serverpod/skills/serverpod-file-uploads
Command: npx skills add https://github.com/serverpod/serverpod --skill serverpod-file-uploads

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Serverpod file uploads are difficult to implement safely across client uploads and server verification, especially when you must support multiple storage backends without exposing sensitive paths or allowing cross-tenant access.

Core Features & Use Cases

  • Upload description + server-driven flow: Generate an upload description on the server, then let the client upload and finally verify the result on the server.
  • Direct file upload verification: Verify uploads after the client completes them, particularly when using object storage backends.
  • Configurable storage backends: Store files in the database by default or use S3/GCP/R2-compatible object storage via dedicated Serverpod cloud storage integrations.
  • Use Case: A Flutter app lets users upload a profile avatar image; the server authorizes the request, scopes the upload path to the authenticated user, stores metadata after verification, and serves the file from the configured storage backend.

Quick Start

Ask the AI how to implement server endpoints for creating an upload description, verifying direct file uploads, and securing the storageId and path for user-scoped uploads in Serverpod.

Frequently Asked Questions about serverpod-file-uploads

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

FAQPage Schema
How do I securely handle file uploads in Serverpod and prevent client-controlled path attacks?

Secure Serverpod file uploads prevent client-controlled path attacks by splitting the workflow into description, upload, and verification steps. The server derives trusted paths scoped to the authenticated user context, ensuring clients cannot write to unauthorized storage locations.

How does direct file upload verification work with S3 or GCP object storage backends?

Direct file upload verification works by having the client upload to object storage like S3 or GCP, then the server verifies the completed upload result before persisting metadata. This post-upload verification ensures only successfully uploaded and authorized files are recorded in the database.

Can I use Serverpod file uploads to scope storage paths for multi-tenant applications?

Yes, Serverpod file uploads can scope storage paths for multi-tenant applications by deriving trusted server-side paths tied to the authenticated user or tenant context. Both upload description and verification endpoints require authorization to prevent cross-tenant access.

What is the best way to implement a profile avatar upload flow in a Flutter app using Serverpod?

The best way to implement a profile avatar upload flow in a Flutter app using Serverpod is a three-step process: generate an upload description on the server, let the client upload the file directly, then verify the upload on the server and persist the file metadata.

Do I need to configure a cloud storage integration to store uploaded files with Serverpod?

No, you do not need to configure a cloud storage integration to store uploaded files with Serverpod. Files are stored in the database by default, but you can optionally configure S3, GCP, or R2-compatible object storage backends via dedicated Serverpod cloud storage integrations.