File objects are generally retrieved from a
FileList object returned as a result of a user selecting files using the
<input> element, from a drag and drop operation's
DataTransfer object, or from the
mozGetAsFile() API on an
File object is a specific kind of
Blob, and can be used in any context that a Blob can. In particular,
XMLHttpRequest.send() accept both
See Using files from web applications for more information and examples.
Returns a newly constructed
Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
File.prototype.lastModifiedDateDeprecated Read only
Returns the last modified
Dateof the file referenced by the
Returns the name of the file referenced by the
File.prototype.webkitRelativePathNon-Standard Read only
Returns the path the URL of the
Fileis relative to.
Blob, so it also has the following properties available to it:
File interface doesn't define any methods, but inherits methods from the
Blob.prototype.slice([start[, end[, contentType]]])
Returns a new
Blobobject containing the data in the specified range of bytes of the source
ReadableStreamthat can be used to read the
Fileinto a stream and reads it to completion. It returns a promise that resolves with a string (text).
Fileinto a stream and reads it to completion. It returns a promise that resolves with an
|File API |
BCD tables only load in the browser