readAsDataURL

The readAsDataURL() method of the FileReader interface is used to read the contents of the specified Blob or File.

MDN Reference