我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

The FileReader() constructor creates a new FileReader.

For details about how to use FileReader, see Using files from web applications.

Syntax

var reader = new FileReader();

Parameters

None.

Example

The following code snippet shows creation of a FileReader object using the FileReader() constructor and subsequent usage of the object:

function printFile(file) {
  var reader = new FileReader();
  reader.onload = function(evt) {
    console.log(evt.target.result);
  };
  reader.readAsText(file);
}

Specifications

Specification Status Comment
File API Working Draft Initial definition

See also

文件標籤與貢獻者

此頁面的貢獻者: gursahani, mdnwebdocs-bot, NotWoods
最近更新: gursahani,