mozilla

Revision 28819 of FileError

  • Revision slug: DOM/FileError
  • Revision title: FileError
  • Revision id: 28819
  • Created:
  • Creator: ziyunfei
  • Is current revision? No
  • Comment 22 words added

Revision Content

Represents an error that occurs while using the {{ domxref("FileReader") }} interface.

Properties

Property Type Description
code unsigned short
The error code.

Error codes

Constant Value Description
ABORT_ERR 3 The file operation was aborted, probably due to a call to the FileReader abort() method.
ENCODING_ERR 5 The file data cannot be accurately represented in a data URL.
NOT_FOUND_ERR 1 File not found.
NOT_READABLE_ERR 4 File could not be read.
SECURITY_ERR 2 The file could not be accessed for security reasons.

See also

  • {{ domxref("FileReader") }}
  • {{ domxref("File") }}
  • {{ domxref("Blob") }}
  • {{ spec("http://www.w3.org/TR/FileAPI/#FileErrorInterface", "Specification: FileAPI FileError", "WD") }}
{{ languages( {"zh-cn": "zh-cn/DOM/FileError" } ) }}

Revision Source

<p>Represents an error that occurs while using the {{ domxref("FileReader") }} interface.</p>
<h2 name="Attributes">Properties</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Property</td> <td class="header">Type</td> <td class="header">Description</td> </tr> <tr> <td><code>code</code></td> <td><code>unsigned short<br> </code></td> <td>The <a href="/en/nsIDOMFileError#Error_codes" title="en/nsIDOMFileError#Error codes">error code</a>.</td> </tr> </tbody>
</table>
<h2>Error codes</h2>
<table class="standard-table"> <thead> <tr> <td class="header">Constant</td> <td class="header">Value</td> <td class="header">Description</td> </tr> </thead> <tbody> <tr> <td><code>ABORT_ERR</code></td> <td>3</td> <td>The file operation was aborted, probably due to a call to the <code>FileReader</code> <code>abort()</code> method.</td> </tr> <tr> <td><code>ENCODING_ERR</code></td> <td>5</td> <td>The file data cannot be accurately represented in a data URL.<br> </td> </tr> <tr> <td><code>NOT_FOUND_ERR</code></td> <td>1</td> <td>File not found.</td> </tr> <tr> <td><code>NOT_READABLE_ERR</code></td> <td>4</td> <td>File could not be read.</td> </tr> <tr> <td><code>SECURITY_ERR</code></td> <td>2</td> <td>The file could not be accessed for security reasons.</td> </tr> </tbody>
</table>
<h2>See also</h2>
<ul> <li>{{ domxref("FileReader") }}</li> <li>{{ domxref("File") }}</li> <li>{{ domxref("Blob") }}</li> <li>{{ spec("http://www.w3.org/TR/FileAPI/#FileErrorInterface", "Specification: FileAPI FileError", "WD") }}</li>
</ul>
{{ languages( {"zh-cn": "zh-cn/DOM/FileError" } ) }}
Revert to this revision