Tiptapex.Upload.LocalDisk (Tiptapex v0.1.2)

Copy Markdown View Source

A ready-made Tiptapex.Upload handler that writes files to local disk. Intended for development, demos, and single-node deployments — for production prefer a handler backed by object storage.

Configure the destination directory and the public URL prefix:

config :tiptapex, Tiptapex.Upload.LocalDisk,
  dir: "priv/uploads",
  url_prefix: "/uploads"

Serve the directory with Plug.Static (or your endpoint):

plug Plug.Static, at: "/uploads", from: "priv/uploads"

Stored files get a random, collision-free name; the original (sanitized) filename is only used for its extension and the returned filename.