files/en-us/web/api/filereadersync/readasdataurl/index.md
{{APIRef("File API")}} {{AvailableInWorkers("worker_except_service")}}
The readAsDataURL() method of the {{DOMxRef("FileReaderSync")}} interface allows to read {{DOMxRef("File")}} or {{DOMxRef("Blob")}} objects in a synchronous way into a string representing a data URL. This interface is only available in workers as it enables synchronous I/O that could potentially block.
readAsDataURL(blob)
blob
A string representing the input data as a data URL.
The following exceptions can be raised by this method:
NotFoundError {{domxref("DOMException")}}
SecurityError {{domxref("DOMException")}}
NotReadableError {{domxref("DOMException")}}
EncodingError {{domxref("DOMException")}}
{{Specifications}}
{{Compat}}