How to enable LiveView File Upload in a component?

It’s possible to upload files in components. You should call allow_upload/3 inside update function instead of mount.

Please note that you have to use <form> inside your component, which makes it impossible to use inside another <form> (HTML doesn’t allow nested forms)

1 Like