-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
The docs are missing this code snippet which shows how to use the auto_upload feature.
allow_upload(socket, :avatar, accept: :any, progress: &handle_progress/3, auto_upload: true)
defp handle_progress(:avatar, entry, socket) do
if entry.done? do
uploaded_file =
consume_uploaded_entry(socket, entry, fn %{} = meta ->
{:ok, ...}
end)
{:noreply, put_flash(socket, :info, "file #{uploaded_file.name} uploaded")}
else
{:noreply, socket}
end
end
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels