2

Let's say I have the following img element in a page that has been created by some unknown Javascript:

<img src="blob:https://examplesite.com/path-to-blob">

can I use the src attribute to download the file associated with this img tag?

I found Read data from BLOB URL in Javascript, but that question is in a different context.

I tried fetch("blob:https://examplesite.com/path-to-blob") in the Chrome DevTools, but I got net::ERR_FILE_NOT_FOUND.

Is there anything I can do to access the data associated with this img tag?

4
  • Removing the blob prefix and using fetch("https://drive.google.com/a6a5ddda-3d77-4065-a59f-acddd1cdb3b7") gives a 404 error. Accessing the URL directly also gives the same "Not Found Error 404" error, which makes sense, because from my reading a blob URL is not a real URL. Commented May 6, 2019 at 0:00
  • Deleted my previous comments, I had forgotten about the format returned by createObjectURL() Commented May 6, 2019 at 0:17
  • blob URLs like that must be created by URL.createObjectURL() and are only valid for the lifetime of the document that created them (or until revokeObjectURL() is called). Where exactly does this URL come from? Commented May 6, 2019 at 0:21
  • @Roymunson Hello, did you find a solution? Commented Jul 10, 2020 at 14:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.