Dev HelpersOpen library
← Back

Read a byte range from a Blob

Read a byte range from a Blob in JavaScript.

Open this example in the interactive library

Source code

const blob = new Blob(["header:message"]);
const range = blob.slice(7, 14, "text/plain");
console.log(range.type, await range.text());

Sample output

text/plain message