Hi, I’m looking for a way to link this. <.live_file_input upload={@uploads.avatar} /> with a field in my database called xlsx_urls to save the urls of the files but I can’t find a way to do it
but the problem occurs when I want to join it with a table called xlsx_urls from my database… what I am looking to achieve is that the url remains in my database so I can consume it later
You won’t get urls. A form submits a stream that you consume, and client side, you have Blob/File. Perhaps use a hook on your form? Something like using the change event: you get a files = evt.target.files that you can store in an outer scoped variable. After this onchange, you can probably use a handleEvent("do-upload", () => self.upload("files", files) (probably need to be careful with the this, maybe define a self=this). The handleEvent can be triggered by a push_event("do-upload") when you want.