createObjectURL

abstract fun createObjectURL(file: File): URL

Create a new URL object which references the provided File or Blob object.

From MDN: "The URL.createObjectURL() static method creates a string containing a URL representing the object given in the parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL represents the specified File object or Blob object. To release an object URL, call revokeObjectURL()."

Return

URL reference for the provided resource.

Parameters

file

File to create a temporary URL reference for.

See also

to create a URL from a blob.

to revoke a created object URL.


abstract fun createObjectURL(blob: Blob): URL

Create a new URL object which references the provided File or Blob object.

From MDN: "The URL.createObjectURL() static method creates a string containing a URL representing the object given in the parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL represents the specified File object or Blob object. To release an object URL, call revokeObjectURL()."

Return

URL reference for the provided resource.

Parameters

blob

Blob to create a temporary URL reference for.

See also

to create a URL from a file.

to revoke a created object URL.