File class

The interface provides information about files and allows JavaScript in a web page to access their content. 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 HTMLCanvasElement. A object is a specific kind of a Blob, and can be used in any context that a Blob can. In particular, FileReader, URL.createObjectURL(), createImageBitmap(), and XMLHttpRequest.send() accept both Blobs and s. See Using files from web applications for more information and examples.

Blob

File

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

File(Iterable fileBits, String fileName, [FilePropertyBag? options])
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
lastModified int

Available on File, provided by the PropsFile extension

no setter
name String

Available on File, provided by the PropsFile extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int

Available on Blob, provided by the PropsBlob extension

no setter
type String

Available on Blob, provided by the PropsBlob extension

no setter
webkitRelativePath String

Available on File, provided by the PropsFile extension

no setter

Methods

arrayBuffer() Future<ByteBuffer>

Available on Blob, provided by the PropsBlob extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
slice([int? start, int? end, String? contentType]) Blob

Available on Blob, provided by the PropsBlob extension

stream() ReadableStream

Available on Blob, provided by the PropsBlob extension

text() Future<String>

Available on Blob, provided by the PropsBlob extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited