开发者

What are the possible ways of getting a Blob object in DOM/JavaScript environment?

MDN Blob page says:

An easy way开发者_运维百科 to construct a Blob is by using the BlobBuilder interface, which lets you iteratively append data to a blob, then retrieve the completed blob when you're ready to use it for something.

But BlobBuilder is not available on every browser where Blob is (Opera for example).

Are there any other ways of getting a Blob?


probably add a check like this on you rpage

**// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
  // Great success! All the File APIs are supported.
} else {
  alert('The File APIs are not fully supported in this browser.');
}**

you can handle the else in any way you want probably an alternative. What do you think?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜