readAsDataURL method
The readAsDataURL()
method of the FileReader interface is used to
read the contents of the specified
Blob or File. When the read operation is finished, the
FileReader.readyState property becomes DONE
, and the
FileReader.loadend_event
event is triggered. At that time, the
FileReader.result attribute contains the data as a data:
URL
representing the
file's data as a base64 encoded string.
Note: The blob's FileReader.result cannot be directly decoded as Base64 without first removing the Data-URL declaration preceding the Base64-encoded data. To retrieve only the Base64 encoded string, first remove
data:*/*;base64,
from the result.
Implementation
external void readAsDataURL(Blob blob);