Hello,
Does anyone knows how the blob:// url that is used in the image preview component is generated when you are uploading a LiveView image?
I’m not sure if that is like an API available from the browser to have a url for an image/file that is being upload at that time so you can access it (to add to <img>
tags, for example) without needing to really upload it to the server first and then serve the image from there or something else.
But, if that is the case, can I somehow have access to that blob url before consuming the image/file and use it afterwards?
Basically what I want to do is to allow the user to upload a bunch of images that will be auto-uploaded, meaning that I will consume then as soon as they arrive, the idea is that after I consume it, I will store the file in some place or in memory until the user submits the form.
After an image is consumed, I want to show it in another component so the images can be reordered before I submit it. But the issue is that I don’t have the blob:// url anymore, so I can’t get the image preview. The only solution that I was able to do is to actually use the image url from the consumed file inside the backend, but that is not a good user experience since the browser will have to redownload the same image back from the backend.