I have a phoenix project with live_view
I generate a CRUD for one of my models
In the form_component I have
socket = allow_upload(socket, :doc, accept: ~w(.pdf), progress: &handle_progress/3, auto_upload: true)
{:ok, socket}
in my form_component_html I have
<.form
let={f}
for={@changeset}
id="document-form"
multipart={true}
phx-target={@myself}
phx-submit="save">
.
.
.
<%= live_file_input @uploads.doc, class: "form-control" %>
The thing is that there is no call to
defp handle_progress(:doc, entry, socket) do
IO.inspect(entry, label: "=========================")
{:noreply, socket}
What am I doing wrong?
my mix.exs file (part of it
defp deps do
[
{:bcrypt_elixir, "~> 2.0"},
{:phoenix, "~> 1.6.5"},
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.17.5"},
...
Any suggestions??