FileReaderSync - Web APIs 编辑
The FileReaderSync
interface allows to read File
or Blob
objects synchronously.
Note:
This feature is available in Web Workers.This interface is only available in workers as it enables synchronous I/O that could potentially block.
Properties
This interface does not have any properties.
Methods
FileReaderSync.readAsArrayBuffer()
- This method converts a specified
Blob
or aFile
into anArrayBuffer
representing the input data as a binary string. FileReaderSync.readAsBinaryString()
- This method converts a specified
Blob
or aFile
into aDOMString
representing the input data as a binary string. This method is deprecated, consider usingreadAsArrayBuffer()
instead. FileReaderSync.readAsText()
- This method converts a specified
Blob
or aFile
into aDOMString
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 specified
Blob
or aFile
into aDOMString
representing the input data as a data URL.
Specifications
Specification | Status | Comment |
---|---|---|
File API The definition of 'FileReaderSync' in that specification. | Working Draft | Initial definition. |
Browser Compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论