LiveView File UploadConfig entries attribute is an empty list

I am using Phoenix Live Uploads for the first time. Inspecting shows entries attribute to be an empty list even after uploading a file.

       |> assign(:user, user)
       |> assign(:token, token)
       |> allow_upload(:photo, accept: ~w(.png .jpeg .jpg), max_entries: 1, max_file_size: 500_000,)

this is the form I am rendering for the upload

<%= form_for @changeset, "#", phx_submit: "save"  %>
  <ul class="list">
      <%= inspect( %>
      <%= live_file_input %>
  <div class="toolbar__center" style="width: 100%; padding-right: 14px; padding-left: 14px; padding-top: 8px; padding-bottom: 8px;">
    <%= submit "Upload", phx_disable_with: "Uploading..." %>

this is the result of inspecting after adding an image to upload

#Phoenix.LiveView.UploadConfig< accept: ".jpg,.jpeg,.png", auto_upload?: false, entries: [], errors: [], max_entries: 1, max_file_size: 500000, name: :photo, progress_event: nil, ref: "phx-Fpf-qu5HLEM4zwth", ... >

What might I be missing

I have not taken care of the “save” event yet. Just wanted to confirm each step of the way but let me handle those 2 events for that reason. Thank you

Hi @Muhammad-Mullah – you will need to configure a phx-change event for your form containing the live_file_input. Otherwise, without the change event, the files will never be pre-flighted to the server.