A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/apis/file/Blob below:

Blob · WebPlatform Docs

Blob Summary

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.

Overview

Blob 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).

Properties

No properties.

Methods
close
Releases the file lock for the associated file resource or frees the memory for the Blob object. After calling this method, performing addition operations on the Blob object fails and throws an exception.
slice
Returns a new Blob object with bytes ranging from its optional start parameter up to but not including its optional end parameter.
Events

No 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
W3C File API Specification
W3C Working Draft
See also Other articles

Saving files locally using Blob and msSaveBlob

Attributions

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