phoenix-uploads
Phoenix File Uploads
RULES — Follow these with no exceptions
- Use manual uploads (NOT auto_upload: true) for form submission patterns
- Always add upload directory to static_paths() — files won't be accessible without this
- Handle upload errors — display error_to_string/1 output in templates
- Create upload directories with File.mkdir_p! before saving files
- Generate unique filenames — prevent collisions and path traversal attacks
- Validate file types server-side — never trust client MIME types
- Restart server after changing static_paths() — changes don't apply until restart
Upload Configuration
Manual Upload (Recommended for Most Cases)
More from j-morgan6/elixir-claude-optimization
elixir-essentials
MANDATORY for ALL Elixir code changes. Invoke before writing any .ex or .exs file.
14phoenix-liveview-essentials
MANDATORY for ALL LiveView work. Invoke before writing LiveView modules or .heex templates.
10phoenix-liveview
INVOKE BEFORE implementing any LiveView feature. REQUIRED for mount, handle_event, handle_info callbacks, file uploads, navigation, PubSub, streams, and LiveView testing. Essential for all LiveView development.
7elixir-patterns
INVOKE BEFORE writing any Elixir code. REQUIRED for pattern matching, pipe operators, with statements, guards, list comprehensions, and naming conventions. Use this skill to ensure idiomatic Elixir patterns.
6testing-essentials
MANDATORY for ALL test files. Invoke before writing any _test.exs file.
6ecto-essentials
MANDATORY for ALL database work. Invoke before modifying schemas, queries, or migrations.
5