asBase64DataUrl

Converts the byte array into a Base64 encoded data URL string.

Return

The Base64 encoded data URL string containing the MIME type and the encoded content.

Parameters

mimeType

The MIME type to include in the data URL, specifying the media type of the data.

See also


fun URL.asBase64DataUrl(mimeType: MimeType = ContentType.defaultForFilePath(this.path).asMimeType()): String

Converts the content of the URL into a Base64 encoded data URL string.

Return

The Base64 encoded data URL string containing the MIME type and the encoded content retrieved from the URL.

Parameters

mimeType

The MIME type to include in the data URL, specifying the media type of the URL's content.

See also

fun File.asBase64DataUrl(mimeType: MimeType = ContentType.defaultForFile(this).toString()): String
fun Path.asBase64DataUrl(mimeType: MimeType = ContentType.Companion .defaultForFilePath( fileName.toString(), ).asMimeType()): String