phoenix-uploads

Configure validated file uploads and static serving in Phoenix applications.

149|15|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/j-morgan6/elixir-phoenix-guide --skill phoenix-uploads
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-uploads
Source: https://github.com/j-morgan6/elixir-phoenix-guide/tree/main/skills/phoenix-uploads
Command: npx skills add https://github.com/j-morgan6/elixir-phoenix-guide --skill phoenix-uploads

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Phoenix apps often struggle with implementing robust file uploads and serving uploaded assets securely. This Skill provides a structured pattern to handle manual uploads, error handling, and static asset serving, reducing risk and boilerplate.

Core Features & Use Cases

  • Upload handling with allow_upload and proper validations
  • Safe static file serving via static_paths and Plug.Static
  • Comprehensive error handling and sanitized file paths for user uploads
  • Use Case: Build a user-upload feature that stores files under priv/static/uploads and serves them at /uploads

Quick Start

Configure an allow_upload in your LiveView, ensure priv/static/uploads is served via static_paths, and reference the generated /uploads URLs in templates to enable file uploads.

Frequently Asked Questions about phoenix-uploads

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

FAQPage Schema
How do I handle file uploads securely in Phoenix LiveView?

Secure file uploads in Phoenix LiveView are handled by configuring allow_upload with proper validations and serving sanitized files via static_paths under priv/static/uploads to ensure safe asset delivery.

What is the best way to serve user-uploaded static files in a Phoenix application?

Serving user-uploaded static files in a Phoenix application is best done by storing files in priv/static/uploads and configuring Plug.Static to safely expose them at the /uploads URL path.

Can I use Phoenix controllers for manual file uploads without LiveView?

Phoenix controllers can handle manual file uploads without LiveView by implementing validated upload logic, sanitized file paths, and comprehensive error messaging for safe file storage.

How do you configure error handling for Phoenix file uploads?

Error handling for Phoenix file uploads is configured by validating allow_upload constraints and generating comprehensive error messages to manage failed uploads and invalid file paths securely.

Why do uploaded files in Phoenix need sanitized file paths?

Uploaded files in Phoenix need sanitized file paths to prevent directory traversal vulnerabilities and ensure user-uploaded assets are safely contained within the designated priv/static/uploads directory.