Creating Blobs and Blob URIs

You may also like...

6 Responses

  1. Kate says:

    Hi Dan, URL.createObjectURL is deprecated now, which is why this line
    var blobUrl = URL.createObjectURL(blob);
    isn’t working anymore. Do you have an idea how to solve this?

    • Dan says:

      Hi Kate, which browser are you using? I just tried it on Chrome 74 and Firefox 66 and it worked. You are right though that the API is deprecated. I’ll see what I can figure out. Thanks for pointing that out!

      Edit: I checked the API docs again and it looks like the URL.createObjectURL(stream) API has been deprecated. The URL.createObjectURL(blob) API still remains and so this code should work. See:

  2. If i’m not wrong, Blob are create on client side(browser dependent) , So how can i manage to save a blob url and save it in DB. so that i can use that in future for all the browser.
    Waiting for you response.

    • Dan says:

      You are correct. Blobs are created on the client-side. You can’t save a blob URL to a database and expect it to work when you retrieve it. You will need to store the original source then load it as a blob.

  3. can a blog image can be created just with Html, CSS and javascript without Json?

  4. achraf hassad says:

    please how can we do this method to convert a normal url to blob:url , i mean like a redirection for exemple , i have website ( when i clicks on it it takes me to (blob: , instead of image i want to use url what to change to make it work , thanks for your great job i appreaciate the work you’re doing hope you answer me and show me the correct code , thanks again

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.