Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. FileReaderSync

FileReaderSync

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Note: This feature is only available inWeb Workers, except forService Workers.

TheFileReaderSync interface allows to readFile orBlob objects synchronously. This interface isonly available inworkers as it enables synchronous I/O that could potentially block.

Constructor

FileReaderSync()

Returns a newFileReaderSync object.

Instance properties

This interface does not have any properties.

Instance methods

FileReaderSync.readAsArrayBuffer()

This method converts a specifiedBlob or aFile into anArrayBuffer representing the input data as a binary string.

FileReaderSync.readAsBinaryString()Deprecated

This method converts a specifiedBlob or aFile into a string representing the input data as a binary string. This method is deprecated, consider usingreadAsArrayBuffer() instead.

FileReaderSync.readAsText()

This method converts a specifiedBlob or aFile into a string representing the input data as a text string. The optionalencoding parameter 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 specifiedBlob or aFile into a string representing the input data as a data URL.

Specifications

Specification
File API
# FileReaderSync

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp