Baseline Widely available
Note: This feature is available in Web Workers.
The FileReader()
constructor creates a new FileReader
.
For details about how to use FileReader
, see Using files from web applications.
None.
ExamplesThe following code snippet shows creation of a FileReader
object using the FileReader()
constructor and subsequent usage of the object:
function printFile(file) {
const reader = new FileReader();
reader.onload = (evt) => {
console.log(evt.target.result);
};
reader.readAsText(file);
}
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4