FileReader error property returns the error that occurred while reading the file.

句法

var error = instanceOfFileReader.error
					

A DOMError containing the relevant error. In Chrome 48+/Firefox 58+ this property returns a DOMException 因为 DOMError has been removed from the DOM standard.

规范

规范 状态 注释
文件 API
The definition of 'FileReader: error' in that specification.
工作草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
error Chrome 7 Edge 12 Firefox 3.6
3.6
Prior to Firefox 13, the error property returned a FileError 对象。
From Firefox 13 to Firefox 58, the error property returned a DOMError 对象。
From Firefox 58, the error 特性返回 DOMException 对象。
IE 10
10
error 特性返回 DOMError 对象。
Opera 11 Safari 6
6
error 特性返回 DOMError 对象。
WebView Android Yes Chrome Android Yes Firefox Android 32
32
From Firefox 32 to Firefox 58, the error property returned a DOMError 对象。
From Firefox 58, the error 特性返回 DOMException 对象。
Opera Android 11 Safari iOS 6.1
6.1
error 特性返回 DOMError 对象。
Samsung Internet Android Yes

图例

完整支持

完整支持

见实现注意事项。

另请参阅

元数据

  • 最后修改:
  1. FileReader
  2. 构造函数
    1. FileReader()
  3. 特性
    1. error
    2. onabort
    3. onload
    4. readyState
    5. result
  4. 方法
    1. abort()
    2. readAsArrayBuffer()
    3. readAsBinaryString()
    4. readAsDataURL()
    5. readAsText()
  5. 事件
    1. abort
    2. error
    3. load
    4. loadend
    5. loadstart
    6. progress
  6. 继承:
    1. EventTarget
  7. 文件 API 相关页面
    1. Blob
    2. File
    3. FileList
    4. FileReaderSync

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1