A JavaScript Blob is an in-memory object for temporarily holding binary or text data and forms the basis of the File API
A JavaScript Blob is an in-memory object for temporarily holding binary or text data and forms the basis of the File API. You can create one from strings or ArrayBuffers and specify a MIME type in the second argument. URL.createObjectURL
turns a Blob into a temporary URL, enabling image display or file downloads. With FileReader you can read the Blob as a Data URL or plain text.
URL.revokeObjectURL
. The blob.slice
method lets you extract portions, and generated URLs should always be revoked when no longer needed. Blobs work seamlessly with fetch
, Service Workers, webcam recording, streaming compressed files, and more. The example runs in any modern browser with no external libraries, making it an ideal learning reference.
Comments
Post a Comment