admin管理员组文章数量:1390677
I have a generated blob url with the following format :
blob:file%3A///2aade.....
I tried to use it directly:
src="blob:file%.... "
and tried it with"blob://" before the url. Which raised a 404 not found error!
what is the correct way to display an image through the blob url?
I have a generated blob url with the following format :
blob:file%3A///2aade.....
I tried to use it directly:
src="blob:file%.... "
and tried it with"blob://" before the url. Which raised a 404 not found error!
what is the correct way to display an image through the blob url?
Share Improve this question edited Feb 8, 2016 at 19:00 Zahema asked Feb 8, 2016 at 18:45 ZahemaZahema 1,4153 gold badges21 silver badges36 bronze badges 4- 1 Read more about FileReader – Alon Eitan Commented Feb 8, 2016 at 19:04
- 1 Maybe you could add some code, show us how you've created this blob, and how you're using it as an image source – adeneo Commented Feb 8, 2016 at 19:05
- 1 Are you sure the blob currently exists in memory? Remember, they only exist on the current page. – Reda Commented Feb 8, 2016 at 19:06
- Alon I have been for a while. adeneo it's extracted by zip.js. Reda it's existence wasn't the problem. thank you guys but I figured out what is wrong. I was trying to display the first item in an array of blobs and it happen to be a directory! not even a file. I tried to display the second item and the direct way worked. thanks again. – Zahema Commented Feb 8, 2016 at 19:28
1 Answer
Reset to default 5The correct way is:
src= "blob:file....."
just set the src to the blob url
My mistake was not making sure it was an image blob in the first place!
本文标签: javascriptHow to use blob URL in img tag srcStack Overflow
版权声明:本文标题:javascript - How to use blob URL in img tag src? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744606829a2615406.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论