Web APIs

URL.createObjectURL()

Try the free JavaScript compiler

Creates a temporary URL associated with a Blob in the supporting host.

Formal Syntax & Structure

javascript syntaxjavascript
URL.createObjectURL(blob)

Parameters & Attributes

NameTypeDescription
blobBlobLocal binary object.

Return Value

string

Creates a temporary URL associated with a Blob in the supporting host.

Working Example

Example Snippetjavascript
(async () => {const url=URL.createObjectURL(new Blob(["x"]));try{console.log(url.startsWith("blob:"));}finally{URL.revokeObjectURL(url);}})()
JavaScript Reference