FileReaderSync
File API workerexceptservice
File API worker_except_service
The FileReaderSync interface allows you to read File or Blob objects synchronously. This interface is only available in workers as it enables synchronous I/O that could potentially block.
Constructor
- FileReaderSync()
- : Returns a new
FileReaderSyncobject.
Instance properties
This interface does not have any properties.
Instance methods
- FileReaderSync.readAsArrayBuffer()
- : This method converts a specified Blob or a File into an ArrayBuffer representing the input data as a binary string.
- FileReaderSync.readAsBinaryString()
- : This method converts a specified Blob or a File into a string representing the input data as a binary string. This method is deprecated, consider using
readAsArrayBuffer()instead. - FileReaderSync.readAsText()
- : This method converts a specified Blob or a File into a string representing the input data as a text string. The optional
encodingparameter indicates the encoding to be used (e.g., iso-8859-1 or UTF-8). If not present, the method will apply a detection algorithm for it. - FileReaderSync.readAsDataURL()
- : This method converts a specified Blob or a File into a string representing the input data as a data URL.
Specifications
Browser compatibility
See also
- FileReader
- Blob
- File