class File extends Blob
The File interface provides information about files and allows JavaScript in a web page to access their content.
File objects are generally retrieved from a FileList object returned as a result of a user selecting files using the element, from a drag and drop operation's DataTransfer object, or from the mozGetAsFile() API on an HTMLCanvasElement. In Gecko, privileged code can create File objects representing any local file without user interaction (see Gecko notes for more information.) A File 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 Files.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/File
- Alphabetic
- By Inheritance
- File
- Blob
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new File(path: String)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(): Unit
Closes the blob object, possibly freeing underlying resources.
Closes the blob object, possibly freeing underlying resources.
- Definition Classes
- Blob
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
isClosed: Boolean
A boolean value, indicating whether the Blob.close() method has been called on the blob.
A boolean value, indicating whether the Blob.close() method has been called on the blob. Closed blobs can not be read.
- Definition Classes
- Blob
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
lastModified: Double
Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
-
def
lastModifiedDate: Date
Returns the last modified date of the file.
Returns the last modified date of the file. Files without a known last modified date returns the current date.
-
def
name: String
Returns the name of the file referenced by the File object.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
size: Int
The size, in bytes, of the data contained in the Blob object.
The size, in bytes, of the data contained in the Blob object.
- Definition Classes
- Blob
-
def
slice(start: Int = js.native, end: Int = js.native, contentType: String = js.native): Blob
Returns a new Blob object containing the data in the specified range of bytes of the source Blob.
Returns a new Blob object containing the data in the specified range of bytes of the source Blob.
- start
An index into the Blob indicating the first byte to include in the new Blob. If you specify a negative value, it's treated as an offset from the end of the string toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is 0. If you specify a value for start that is larger than the size of the source Blob, the returned Blob has size 0 and contains no data.
- end
An index into the Blob indicating the first byte that will *not* be included in the new Blob (i.e. the byte exactly at this index is not included). If you specify a negative value, it's treated as an offset from the end of the string toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is size.
- contentType
The content type to assign to the new Blob; this will be the value of its type property. The default value is an empty string.
- returns
A new Blob object containing the specified data from the source Blob.
- Definition Classes
- Blob
var blob = instanceOfBlob.slice([start [, end [, contentType]]]);
Example: -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
type: String
The size, in bytes, of the data contained in the Blob object.
The size, in bytes, of the data contained in the Blob object.
- Definition Classes
- Blob
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
webkitRelativePath: File
The File.webkitRelativePath is a read-only property that contains a DOMString with the path relative to the directory selected when the webkitdirectory has been set on the element.
The File.webkitRelativePath is a read-only property that contains a DOMString with the path relative to the directory selected when the webkitdirectory has been set on the element.