Zerog
[Arc/Waffle] Upload an image via ajax, how to set this image in a changeset
Hey everyone, just a bit stuck on this problem.
So I upload an image via ajax, and i save it using a Waffle uploader: Uploaders.Article.Image.store(“my-image-name.jpg”).
Now the problem i’m having is I want to reference this image in my Article changeset, i.e. changeset = Article.changeset(article, %{image: file}), but I have no idea how to do this.
I’ve tried setting file = %Plug.Upload{filename: “my-image.jpg”}, but this doesn’t work. I really have no idea what else could work, so any insights would be greatly appreciated. Thanks!
Marked As Solved
Bumppoman
Yes, LiveView doesn’t currently support file uploads. However, I have been using the workaround linked here to great success: https://github.com/phoenixframework/phoenix_live_view/issues/104#issuecomment-557849826







