files/en-us/web/api/filereadersync/readasbinarystring/index.md
{{APIRef("File API")}}{{deprecated_header}} {{AvailableInWorkers("worker_except_service")}}
[!NOTE] This method is deprecated in favor of {{DOMxRef("FileReaderSync.readAsArrayBuffer","readAsArrayBuffer()")}}.
The readAsBinaryString() method of the {{DOMxRef("FileReaderSync")}} interface allows to read {{DOMxRef("File")}} or {{DOMxRef("Blob")}} objects in a synchronous way into a string. This interface is only available in workers as it enables synchronous I/O that could potentially block.
readAsBinaryString(blob)
blob
A string representing the input data.
NotFoundError {{domxref("DOMException")}}
SecurityError {{domxref("DOMException")}}
NotReadableError {{domxref("DOMException")}}
EncodingError {{domxref("DOMException")}}
{{Specifications}}
{{Compat}}