The File object provides information about files stored on the user’s computer, and access to their contents. These are generally retrieved from a FileList object returned when a user selects files using the input element, or from a drag-and-drop operation’s DataTransfer object.
PropertiesNo methods.
EventsNo events.
ExamplesUsing form input for selecting files
function handleFileSelect(evt) {
var files = evt.target.files;
var output = [];
for (var i = 0, f; f = files[i]; i++) {
output.push(escape(f.name),
f.size, ' bytes, last modified: ',
f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a');
}
document.getElementById('list').innerHTML = output.join('');
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
Related specifications
Mozilla Developer Network : [File Article]
Microsoft Developer Network: [file Object Article]
Portions of this content come from HTML5Rocks! article
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