jayarjo
jayarjo

Reputation: 16716

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?

Upvotes: 0

Views: 794

Answers (1)

Baz1nga
Baz1nga

Reputation: 15579

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?

Upvotes: 1

Related Questions