I have a form that has a text input and a file input. Anyway to push that over the socket on submit?
If I add it like this
params.image = $("#new_post_image")[0].files[0]
My params look like this in the channel
%{image: %{}, title: "image title"}
I have a form that has a text input and a file input. Anyway to push that over the socket on submit?
If I add it like this
params.image = $("#new_post_image")[0].files[0]
My params look like this in the channel
%{image: %{}, title: "image title"}
I would reason that this approach is basically wrong. Instead, the file upload should be handled by a multipart form upload, which should then return a file ID and then you can attach that ID to the form so it keeps the reference.