Class

io.scalajs.dom.html

File

Related Doc: package html

Permalink

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

Linear Supertypes
Blob, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. File
  2. Blob
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new File(path: String)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def close(): Unit

    Permalink

    Closes the blob object, possibly freeing underlying resources.

    Closes the blob object, possibly freeing underlying resources.

    Definition Classes
    Blob
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def isClosed: Boolean

    Permalink

    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
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  16. def lastModified: Double

    Permalink

    Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).

  17. def lastModifiedDate: Date

    Permalink

    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.

  18. def name: String

    Permalink

    Returns the name of the file referenced by the File object.

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  23. def size: Int

    Permalink

    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
  24. def slice(start: Int = js.native, end: Int = js.native, contentType: String = js.native): Blob

    Permalink

    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
    Example:
    1. var blob = instanceOfBlob.slice([start [, end [, contentType]]]);
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. def type: String

    Permalink

    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
  29. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. def webkitRelativePath: File

    Permalink

    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.

Inherited from Blob

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped