While Uploading files with LiveView, is not returning %Plug.Upload{}
struct in handle_event/3
function, instead it is returning string something like this "[object File]"
. Do I need to parse this string to get the struct or there is some different way to handle File uploading with LiveView.
Below is my code for reference.
<%= form_for @changeset, "#", [class: "add-candidate-form w-100", id: "applicant-form", multipart: true, phx_change: :validate, phx_submit: :save], fn f -> %>
<div class="form-group col-6">
<label>Resume <span class="text-danger">*</span></label>
<div class="input-group">
<div class="custom-file">
<%= file_input f, :resume, [class: "custom-file-input", id: "inputGroupFile01", file_input: "one"] %>
<label class="custom-file-label" for="">Max size 2 mb</label>
</div>
</div>
</div>
<% end %>
When not using LiveView, this is working fine and I am getting %Plug.Upload{}
struct in the params on submitting the form.