# `CKEditor5.Upload.Controller`
[🔗](https://github.com/Mati365/ckeditor5-phoenix/blob/v1.28.2/lib/upload/upload_controller.ex#L1)

Controller for handling image uploads from CKEditor 5.

This controller provides a simple upload endpoint that saves uploaded files.

## Configuration

You can configure the upload directory and the base URL for the uploaded files in your `config.exs`:

    config :ckeditor5_phoenix, :uploads,
      folder: "priv/static/uploads",
      url: "/uploads"

## Usage

Add this to your router:

    scope "/api/ckeditor5" do
      post "/upload", CKEditor5.Upload.Controller, :upload
    end

# `upload`

Handles file upload from CKEditor 5.

Expects a multipart/form-data request with a "file" parameter.
Returns JSON with the uploaded file URL or an error message.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
