How can i upload multiple images for one user in elixiiir

how can i upload multiple images for one user

What have you tried so far and what libraries are you using to manage file uploads in general?

2 Likes

I have done something similar using waffle and waffle_ecto.

I would not modify the user schema, instead I would create an exclusive schema for the images and link the images and users schema using a has_many relation.

Hello,

I’ve had issues with this somewhat myself and thought to provide some sample code. The code is definitely not the cleanest, but just meant to illustrate something :slight_smile:

Hope it is helpful. https://github.com/WannesFransen1994/phoenix-dynamic-images

Best of luck!

You mean you created an entity type (model) called for instance image and defined the users schema to have multiple images, with each image containing one single uploaded image associated with the user?

@acrolink

Exactly.