FileReader

  • Revision slug: Web/API/FileReader
  • Revision title: FileReader
  • Revision id: 400299
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment Moved From DOM/FileReader to Web/API/FileReader

Revision Content

The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using {{ domxref("File") }} or {{ domxref("Blob") }} objects to specify the file or data to read. File objects may be obtained from a {{ domxref("FileList") }} object returned as a result of a user selecting files using the {{ HTMLElement("input") }} element, from a drag and drop operation's DataTransfer object, or from the mozGetAsFile() API on an {{ domxref("HTMLCanvasElement") }}.

To create a FileReader, simply do the following:

var reader = new FileReader();

See Using files from web applications for details and examples.

Important note about input parameters

Note that in Gecko 1.9.2 {{ geckoRelease("1.9.2") }} and early builds of Firefox 4, this interface used {{ domxref("File") }} objects to specify files; the specification uses Blob objects. Starting in Gecko 2.0 (beta 7) {{ geckoRelease("2.0") }}, the implementation matches the specification. This may result in some changes being needed to your code, especially if you used the non-standard Mozilla-specific methods that have been deprecated on the File object.

Method overview

void abort();
void readAsArrayBuffer(in Blob blob); {{ gecko_minversion_inline("7.0") }}
void readAsBinaryString(in Blob blob);
void readAsDataURL(in Blob file);
void readAsText(in Blob blob, [optional] in DOMString encoding);

State constants

Constant Value Description
EMPTY 0 No data has been loaded yet.
LOADING 1 Data is currently being loaded.
DONE 2 The entire read request has been completed.

Properties

Property Type Description
error {{ domxref("DOMError") }} The error that occurred while reading the file. Read only.
readyState unsigned short Indicates the state of the FileReader. This will be one of the {{ anch("State constants") }}. Read only.
result {{ jsapixref("jsval") }} The file's contents. This property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation. Read only.

Methods

abort()

Aborts the read operation. Upon return, the readyState will be DONE.

void abort();
Parameters

None.

Exceptions thrown
DOM_FILE_ABORT_ERR
abort() was called while no read operation was in progress (that is, the state wasn't LOADING). {{ note("This exception was not thrown by Gecko until Gecko 6.0.") }}

{{ method_gecko_minversion("readAsArrayBuffer","7.0") }}

Starts reading the contents of the specified {{ domxref("Blob") }} or {{ domxref("File") }}. When the read operation is finished, the readyState will become DONE, and the onloadend callback, if any, will be called. At that time, the result attribute contains an ArrayBuffer representing the file's data.

void readAsArrayBuffer(
  in Blob blob
);
Parameters
blob
The DOM {{ domxref("Blob") }} or {{ domxref("File") }} to read into the ArrayBuffer.

readAsBinaryString()

Starts reading the contents of the specified {{ domxref("Blob") }}, which may be a {{ domxref("File") }}. When the read operation is finished, the readyState will become DONE, and the onloadend callback, if any, will be called. At that time, the result attribute contains the raw binary data from the file.

void readAsBinaryString(
  in Blob blob
);

This method, used in conjuncton with the sendAsBinary XMLHttpRequest's method, make possible to read and upload any type of file.

Parameters
blob
The DOM {{ domxref("Blob") }} or {{ domxref("File") }} from which to read.

readAsDataURL()

Starts reading the contents of the specified {{ domxref("Blob") }} or {{ domxref("File") }}. When the read operation is finished, the readyState will become DONE, and the onloadend callback, if any, will be called. At that time, the result attribute contains a data: URL representing the file's data.

void readAsDataURL(
  in Blob file
);
Parameters
file
The DOM {{ domxref("Blob") }} or {{ domxref("File") }} from which to read.
Example

This method is useful, for example, to get a preview of an image before uploading it (download example):

<!doctype html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Image preview example</title>
<script type="text/javascript">
oFReader = new FileReader(), rFilter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\/x\-xwindowdump)$/i;

oFReader.onload = function (oFREvent) {
  document.getElementById("uploadPreview").src = oFREvent.target.result;
};

function loadImageFile() {
  if (document.getElementById("uploadImage").files.length === 0) { return; }
  var oFile = document.getElementById("uploadImage").files[0];
  if (!rFilter.test(oFile.type)) { alert("You must select a valid image file!"); return; }
  oFReader.readAsDataURL(oFile);
}
</script>
</head>

<body onload="loadImageFile();">
  <form name="uploadForm">
    <table>
      <tbody>
        <tr>
          <td><img id="uploadPreview" style="width: 100px; height: 100px;" src="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Csvg%20width%3D%22153%22%20height%3D%22153%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%20%3Cg%3E%0A%20%20%3Ctitle%3ENo%20image%3C/title%3E%0A%20%20%3Crect%20id%3D%22externRect%22%20height%3D%22150%22%20width%3D%22150%22%20y%3D%221.5%22%20x%3D%221.500024%22%20stroke-width%3D%223%22%20stroke%3D%22%23666666%22%20fill%3D%22%23e1e1e1%22/%3E%0A%20%20%3Ctext%20transform%3D%22matrix%286.66667%2C%200%2C%200%2C%206.66667%2C%20-960.5%2C%20-1099.33%29%22%20xml%3Aspace%3D%22preserve%22%20text-anchor%3D%22middle%22%20font-family%3D%22Fantasy%22%20font-size%3D%2214%22%20id%3D%22questionMark%22%20y%3D%22181.249569%22%20x%3D%22155.549819%22%20stroke-width%3D%220%22%20stroke%3D%22%23666666%22%20fill%3D%22%23000000%22%3E%3F%3C/text%3E%0A%20%3C/g%3E%0A%3C/svg%3E" alt="Image preview" /></td>
          <td><input id="uploadImage" type="file" name="myPhoto" onchange="loadImageFile();" /></td>
        </tr>
      </tbody>
    </table>

    <p><input type="submit" value="Send" /></p>
  </form>
</body>
</html>
Note: The constructor FileReader() was not supported by Internet Explorer for versions before 10. For a full compatibility code you can see our crossbrowser preview possible solution.

readAsText()

Starts reading the specified blob's contents. When the read operation is finished, the readyState will become DONE, and the onloadend callback, if any, will be called. At that time, the result attribute contains the contents of the file as a text string.

void readAsText(
  in Blob blob,
  in DOMString encoding {{ optional_inline() }}
);
Parameters
blob
The DOM {{ domxref("Blob") }} or {{ domxref("File") }} from which to read.
encoding {{ optional_inline() }}
A string indicating the encoding to use for the returned data. By default, UTF-8 is assumed if this parameter is not specified.

Event handlers

onabort
Called when the read operation is aborted.
onerror
Called when an error occurs.
onload
Called when the read operation is successfully completed.
onloadend
Called when the read is completed, whether successful or not. This is called after either onload or onerror.
onloadstart
Called when reading the data is about to begin.
onprogress
Called periodically while the data is being read.

Browser compatibility

{{ CompatibilityTable() }}

Feature Firefox (Gecko) Chrome Internet Explorer* Opera* Safari
Basic support {{ CompatGeckoDesktop("1.9.2") }} 7 10 12.02 6.0.2
Feature Firefox Mobile (Gecko) Android IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

*IE9 has a File API Lab. Opera has partial support in 11.1.

Gecko-specific notes

  • Prior to Gecko 2.0 beta 7 (Firefox 4.0 beta 7), all {{ domxref("Blob") }} parameters below were {{ domxref("File") }} parameters; this has since been updated to match the specification correctly.
  • Prior to Gecko 13.0 {{ geckoRelease("13.0") }} the FileReader.error property returned a {{ domxref("FileError") }} object. This interface has been removed and FileReader.error is now returning the {{ domxref("DOMError") }} object as defined in the latest FileAPI draft.

See also

  • Using files from web applications
  • {{ domxref("File") }}
  • {{ spec("http://www.w3.org/TR/FileAPI/#FileReader-interface", "Specification: File API: FileReader", "WD") }}

Revision Source

<p>The <code>FileReader</code> object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using {{ domxref("File") }} or {{ domxref("Blob") }} objects to specify the file or data to read. File objects may be obtained from a {{ domxref("FileList") }} object returned as a result of a user selecting files using the {{ HTMLElement("input") }} element, from a drag and drop operation's <a href="/En/DragDrop/DataTransfer" title="En/DragDrop/DataTransfer"><code>DataTransfer</code></a> object, or from the <code>mozGetAsFile()</code> API on an&nbsp;{{ domxref("HTMLCanvasElement") }}.</p>
<p>To create a <code>FileReader</code>, simply do the following:</p>
<pre>
var reader = new FileReader();
</pre>
<p>See <a href="/en/Using_files_from_web_applications" title="en/Using files from web applications">Using files from web applications</a> for details and examples.</p>
<h2 id="Important_note_about_input_parameters">Important note about input parameters</h2>
<p>Note that in Gecko 1.9.2 {{ geckoRelease("1.9.2") }} and early builds of Firefox 4, this interface used {{ domxref("File") }} objects to specify files; the specification uses <code>Blob</code> objects. Starting in Gecko 2.0 (beta 7) {{ geckoRelease("2.0") }}, the implementation matches the specification. This may result in some changes being needed to your code, especially if you used the non-standard Mozilla-specific methods that have been deprecated on the <code>File</code> object.</p>
<h2 id="Method_overview" name="Method_overview">Method overview</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <td><code>void <a href="#abort()">abort</a>();</code></td>
    </tr>
    <tr>
      <td><code>void <a href="#readAsArrayBuffer()">readAsArrayBuffer</a>(in Blob blob);</code> {{ gecko_minversion_inline("7.0") }}</td>
    </tr>
    <tr>
      <td><code>void <a href="#readAsBinaryString()">readAsBinaryString</a>(in Blob blob);</code></td>
    </tr>
    <tr>
      <td><code>void <a href="#readAsDataURL()">readAsDataURL</a>(in Blob file);</code></td>
    </tr>
    <tr>
      <td><code>void <a href="#readAsText()">readAsText</a>(in Blob blob, [optional] in DOMString encoding);</code></td>
    </tr>
  </tbody>
</table>
<h2 id="State_constants" name="State_constants">State constants</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <td class="header">Constant</td>
      <td class="header">Value</td>
      <td class="header">Description</td>
    </tr>
    <tr>
      <td><code>EMPTY</code></td>
      <td><code>0</code></td>
      <td>No data has been loaded yet.</td>
    </tr>
    <tr>
      <td><code>LOADING</code></td>
      <td><code>1</code></td>
      <td>Data is currently being loaded.</td>
    </tr>
    <tr>
      <td><code>DONE</code></td>
      <td><code>2</code></td>
      <td>The entire read request has been completed.</td>
    </tr>
  </tbody>
</table>
<h2 id="Properties" name="Properties">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>error</code></td>
      <td>{{ domxref("DOMError") }}</td>
      <td>The error that occurred while reading the file. <strong>Read only.</strong></td>
    </tr>
    <tr>
      <td><code>readyState</code></td>
      <td><code><a href="/en/unsigned_short" title="en/unsigned short">unsigned short</a></code></td>
      <td>Indicates the state of the <code>FileReader</code>. This will be one of the {{ anch("State constants") }}. <strong>Read only.</strong></td>
    </tr>
    <tr>
      <td><code>result</code></td>
      <td>{{ jsapixref("jsval") }}</td>
      <td>The file's contents. This property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation. <strong>Read only.</strong></td>
    </tr>
  </tbody>
</table>
<h2 id="Methods" name="Methods">Methods</h2>
<h3 id="abort()" name="abort()">abort()</h3>
<p>Aborts the read operation. Upon return, the <code>readyState</code> will be <code>DONE</code>.</p>
<pre class="eval">
void abort();
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<p>None.</p>
<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
<dl>
  <dt>
    <code>DOM_FILE_ABORT_ERR</code></dt>
  <dd>
    <code>abort()</code> was called while no read operation was in progress (that is, the state wasn't <code>LOADING</code>). {{ note("This exception was not thrown by Gecko until Gecko 6.0.") }}</dd>
</dl>
<p>{{ method_gecko_minversion("readAsArrayBuffer","7.0") }}</p>
<p>Starts reading the contents of the specified {{ domxref("Blob") }} or {{ domxref("File") }}. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains an <code><a href="/en/JavaScript_typed_arrays/ArrayBuffer" title="/en/JavaScript_typed_arrays/ArrayBuffer">ArrayBuffer</a></code> representing the file's data.</p>
<pre class="eval">
void readAsArrayBuffer(
  in Blob blob
);
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>blob</code></dt>
  <dd>
    The DOM {{ domxref("Blob") }} or {{ domxref("File") }} to read into the <code><a href="/en/JavaScript_typed_arrays/ArrayBuffer" title="/en/JavaScript_typed_arrays/ArrayBuffer">ArrayBuffer</a></code>.</dd>
</dl>
<h3 id="readAsBinaryString()" name="readAsBinaryString()">readAsBinaryString()</h3>
<p>Starts reading the contents of the specified {{ domxref("Blob") }}, which may be a {{ domxref("File") }}. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains the raw binary data from the file.</p>
<pre class="eval">
void readAsBinaryString(
  in Blob blob
);
</pre>
<p>This method, used in conjuncton with the <a href="/en-US/docs/DOM/XMLHttpRequest#sendAsBinary()" title="/en-US/docs/DOM/XMLHttpRequest#sendAsBinary()"><code>sendAsBinary</code></a> <a href="/en-US/docs/DOM/XMLHttpRequest" title="/en-US/docs/DOM/XMLHttpRequest"><code>XMLHttpRequest</code></a>'s method, make possible to <a href="/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Submitting_forms_and_uploading_files" title="/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Submitting_forms_and_uploading_files">read and <strong>upload</strong> any type of file</a>.</p>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>blob</code></dt>
  <dd>
    The DOM {{ domxref("Blob") }} or {{ domxref("File") }} from which to read.</dd>
</dl>
<h3 id="readAsDataURL()" name="readAsDataURL()">readAsDataURL()</h3>
<p>Starts reading the contents of the specified {{ domxref("Blob") }} or {{ domxref("File") }}. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains a <code>data:</code> URL representing the file's data.</p>
<pre class="eval">
void readAsDataURL(
  in Blob file
);
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>file</code></dt>
  <dd>
    The DOM {{ domxref("Blob") }} or {{ domxref("File") }} from which to read.</dd>
</dl>
<h6 id="Example">Example</h6>
<p>This method is useful, for example, to get a preview of an image before uploading it (<a class="internal" href="/@api/deki/files/6231/=image_upload_preview.html" title="image_upload_preview.html">download example</a>):</p>
<pre class="brush: html">
&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /&gt;
&lt;title&gt;Image preview example&lt;/title&gt;
&lt;script type="text/javascript"&gt;
oFReader = new FileReader(), rFilter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\/x\-xwindowdump)$/i;

oFReader.onload = function (oFREvent) {
&nbsp; document.getElementById("uploadPreview").src = oFREvent.target.result;
};

function loadImageFile() {
&nbsp; if (document.getElementById("uploadImage").files.length === 0) { return; }
&nbsp; var oFile = document.getElementById("uploadImage").files[0];
&nbsp; if (!rFilter.test(oFile.type)) { alert("You must select a valid image file!"); return; }
&nbsp; oFReader.readAsDataURL(oFile);
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body onload="loadImageFile();"&gt;
  &lt;form name="uploadForm"&gt;
    &lt;table&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;img id="uploadPreview" style="width: 100px; height: 100px;" src="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Csvg%20width%3D%22153%22%20height%3D%22153%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%20%3Cg%3E%0A%20%20%3Ctitle%3ENo%20image%3C/title%3E%0A%20%20%3Crect%20id%3D%22externRect%22%20height%3D%22150%22%20width%3D%22150%22%20y%3D%221.5%22%20x%3D%221.500024%22%20stroke-width%3D%223%22%20stroke%3D%22%23666666%22%20fill%3D%22%23e1e1e1%22/%3E%0A%20%20%3Ctext%20transform%3D%22matrix%286.66667%2C%200%2C%200%2C%206.66667%2C%20-960.5%2C%20-1099.33%29%22%20xml%3Aspace%3D%22preserve%22%20text-anchor%3D%22middle%22%20font-family%3D%22Fantasy%22%20font-size%3D%2214%22%20id%3D%22questionMark%22%20y%3D%22181.249569%22%20x%3D%22155.549819%22%20stroke-width%3D%220%22%20stroke%3D%22%23666666%22%20fill%3D%22%23000000%22%3E%3F%3C/text%3E%0A%20%3C/g%3E%0A%3C/svg%3E" alt="Image preview" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="uploadImage" type="file" name="myPhoto" onchange="loadImageFile();" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;

    &lt;p&gt;&lt;input type="submit" value="Send" /&gt;&lt;/p&gt;
  &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<div class="note">
  <strong>Note:</strong> The constructor <code>FileReader()</code> was not supported by Internet Explorer for versions before 10. For a full compatibility code you can see our <a class="internal" href="/@api/deki/files/6232/=crossbrowser_image_preview.html" title="crossbrowser_image_preview.html">crossbrowser preview possible solution</a>.</div>
<h3 id="readAsText()" name="readAsText()">readAsText()</h3>
<p>Starts reading the specified blob's contents. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains the contents of the file as a text string.</p>
<pre class="eval">
void readAsText(
  in Blob blob,
  in DOMString encoding {{ optional_inline() }}
);
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl>
  <dt>
    <code>blob</code></dt>
  <dd>
    The DOM {{ domxref("Blob") }} or {{ domxref("File") }} from which to read.</dd>
  <dt>
    <code>encoding</code> {{ optional_inline() }}</dt>
  <dd>
    A string indicating the encoding to use for the returned data. By default, UTF-8 is assumed if this parameter is not specified.</dd>
</dl>
<h2 id="Event_handlers">Event handlers</h2>
<dl>
  <dt>
    <code>onabort</code></dt>
  <dd>
    Called when the read operation is aborted.</dd>
  <dt>
    <code>onerror</code></dt>
  <dd>
    Called when an error occurs.</dd>
  <dt>
    <code>onload</code></dt>
  <dd>
    Called when the read operation is successfully completed.</dd>
  <dt>
    <code>onloadend</code></dt>
  <dd>
    Called when the read is completed, whether successful or not. This is called after either <code>onload</code> or <code>onerror</code>.</dd>
  <dt>
    <code>onloadstart</code></dt>
  <dd>
    Called when reading the data is about to begin.</dd>
  <dt>
    <code>onprogress</code></dt>
  <dd>
    Called periodically while the data is being read.</dd>
</dl>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Firefox (Gecko)</th>
        <th>Chrome</th>
        <th>Internet Explorer*</th>
        <th>Opera*</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatGeckoDesktop("1.9.2") }}</td>
        <td>7</td>
        <td>10</td>
        <td>12.02</td>
        <td>6.0.2</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>Android</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<p>*IE9 has a <a class="external" href="http://html5labs.interoperabilitybridges.com/prototypes/fileapi/fileapi/info" title="http://html5labs.interoperabilitybridges.com/prototypes/fileapi/fileapi/info">File API Lab</a>. Opera has <a class="external" href="http://www.opera.com/docs/specs/presto28/file/" title="http://my.opera.com/desktopteam/blog/2011/04/05/stability-gmail-socks">partial support</a> in 11.1.</p>
<h3 id="Gecko-specific_notes">Gecko-specific notes</h3>
<ul>
  <li>Prior to Gecko 2.0 beta 7 (Firefox 4.0 beta 7), all {{ domxref("Blob") }} parameters below were {{ domxref("File") }} parameters; this has since been updated to match the specification correctly.</li>
  <li>Prior to Gecko 13.0 {{ geckoRelease("13.0") }} the <code>FileReader.error</code> property returned a {{ domxref("FileError") }} object. This interface has been removed and <code>FileReader.error</code> is now returning the {{ domxref("DOMError") }} object as defined in the latest FileAPI draft.</li>
</ul>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li><a href="/en/Using_files_from_web_applications" title="en/Using files from web applications">Using files from web applications</a></li>
  <li>{{ domxref("File") }}</li>
  <li>{{ spec("http://www.w3.org/TR/FileAPI/#FileReader-interface", "Specification:&nbsp;File API: FileReader", "WD") }}</li>
</ul>
Revert to this revision