Search documentation of phoenix_kit

# PhoenixKitWeb.UploadController (phoenix_kit v1.7.87)

Copy Markdown View Source

File upload controller for handling multipart uploads.

Accepts file uploads, validates them, and queues them for background processing.

## Summary

### Functions

create(conn, params)

Upload a file via multipart form.

## Functions

# create(conn, params)

Upload a file via multipart form.

## Request

    POST /api/upload

## Parameters

- `file` (required): The file to upload (multipart/form-data)
- `user_uuid` (optional): Override user UUID (admin only)

## Response

Success (200):

    {
      "file_uuid": "uuidv7-string",
      "original_filename": "photo.jpg",
      "file_type": "image",
      "mime_type": "image/jpeg",
      "size": 1234567,
      "status": "processing",
      "message": "Upload successful, processing variants..."
    }

Error (400):

    {
      "error": "INVALID_FILE_TYPE",
      "message": "File type not allowed"
    }

Error (413):

    {
      "error": "FILE_TOO_LARGE",
      "message": "File size exceeds maximum allowed (100MB)"
    }