The Blob object represents immutable raw data. It provides a method to slice data objects between ranges of bytes into further chunks of raw data.
OverviewBlob provides an attribute representing the size of the chunk of data. The File object inherits from the Blob object. Blob objects can be read asynchronously only on the main thread via FileReader objects, but metadata access via attributes such as size and type return synchronously (this trade-off is based on the underlying assumption that metadata access will not significantly block or disrupt the browser’s main thread, whereas reading Blob data will).
PropertiesNo properties.
MethodsNo events.
Examples// Example for creating a URL to a typed array using a blob
var typedArray = GetTheTypedArraySomehow();
var blob = new Blob([typedArray], {type: "application/octet-binary"});
var url = URL.createObjectURL(blob);
// Blob constructor example usage
var aFileParts = ['<a id="a"><b id="b">hey!</b></a>'];
var oMyBlob = new Blob(aFileParts, { "type" : "text/xml" });
Related specifications
Saving files locally using Blob and msSaveBlob
AttributionsMozilla Developer Network : [Blob Article]
Microsoft Developer Network: [blob constructor Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4