Skip to main content

toDataURL()

Last updated 30/10/2024

The

toDataURL()
is a function on the
Five
object that encodes the contents supplied in the data parameter as a data URI with the supplied Multipurpose Internet Mail Extention (MIME) type.

Supported MIME Types

Available

Server

Function Signature
toDataURL(mimeType: string, data: string): string;

ParameterTypeDescription
mimeType
stringMedia type of the data parameter
data
stringMedia contents

Return Value

A string representing the contents of the data as a data URI.

Examples

toDataURL()