The File interface provides information about files and allows in a web page to access their content.
The File interface provides information about files and allows in a web page to access their content.
Constructor.
The File() constructor creates a new web.files.File
object instance.
bits
An js.Array
of js.ArrayBuffer
, web.typed.ArrayBufferView
, web.files.Blob
, or web.dom.DOMString
objects — or a mix of any such objects. This is the file content encoded as UTF-8.
name
A web.USVString
representing the file name or the path to the file.
options Optional
An options object containing optional attributes for the file. Available options are as follows:
type: A web.dom.DOMString
representing the MIME type of the content that will be put into the file. Defaults to a value of "".
lastModified: A number representing the number of milliseconds between the Unix time epoch and when the file was last modified. Defaults to a value of Date.now()
.
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/File
Constructor. The File() constructor creates a new `web.files.File` object instance. bits An `js.Array` of `js.ArrayBuffer`, `web.typed.ArrayBufferView`, `web.files.Blob`, or `web.dom.DOMString` objects — or a mix of any such objects. This is the file content encoded as UTF-8. name A `web.USVString` representing the file name or the path to the file. options Optional An options object containing optional attributes for the file. Available options are as follows: type: A `web.dom.DOMString` representing the MIME type of the content that will be put into the file. Defaults to a value of \"\". lastModified: A number representing the number of milliseconds between the Unix time epoch and when the file was last modified. Defaults to a value of `Date.now()`. See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/File`
(file-name this)
Property.
Returns the name of the file. For security reasons the path is from this property.
var name = instanceOfFile.fileName;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/fileName
Property. Returns the name of the file. For security reasons the path is from this property. `var name = instanceOfFile.fileName;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/fileName`
(file-size this)
Property.
Returns the size of a file in bytes.
var size = instanceOfFile.fileSize;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/fileSize
Property. Returns the size of a file in bytes. `var size = instanceOfFile.fileSize;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/fileSize`
(get-as-binary this)
Method.
The getAsBinary method allows to access the file's data in raw format.
var binary = instanceOfFile.getAsBinary();
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/getAsBinary
Method. The getAsBinary method allows to access the file's data in raw format. `var binary = instanceOfFile.getAsBinary();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/getAsBinary`
(get-as-data-url this)
Method.
The getAsDataURL provides a data:
URL that encodes the entire
of the referenced file.
var url = instanceOfFile.getAsDataURL();
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/getAsDataURL
Method. The getAsDataURL provides a `data:` URL that encodes the entire of the referenced file. `var url = instanceOfFile.getAsDataURL();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/getAsDataURL`
(get-as-text this encoding)
Method.
The getAsText method provides the file's data interpreted as using a given encoding.
var str = instanceOfFile.getAsText(encoding);
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/getAsText
Method. The getAsText method provides the file's data interpreted as using a given encoding. `var str = instanceOfFile.getAsText(encoding);` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/getAsText`
(last-modified this)
Property.
The File.lastModified read-only property provides the last modified of the file as the number of milliseconds since the Unix epoch 1, 1970 at midnight). Files without a known last modified date the current date.
const time = instanceOfFile.lastModified;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified
Property. The File.lastModified read-only property provides the last modified of the file as the number of milliseconds since the Unix epoch 1, 1970 at midnight). Files without a known last modified date the current date. `const time = instanceOfFile.lastModified;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified`
(last-modified-date this)
Property.
The File.lastModifiedDate read-only property returns the last date of the file. Files without a known last modified date returns current date .
var time = instanceOfFile.lastModifiedDate
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/lastModifiedDate
Property. The File.lastModifiedDate read-only property returns the last date of the file. Files without a known last modified date returns current date . `var time = instanceOfFile.lastModifiedDate` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/lastModifiedDate`
(moz-full-path this)
Property.
A privileged exension to the web.files.File
interface, the
property contains the full pathname of the represented file.
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/mozFullPath
Property. A privileged exension to the `web.files.File` interface, the property contains the full pathname of the represented file. See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/mozFullPath`
(name this)
Property.
Returns the name of the file represented by a web.files.File
For security reasons, the path is excluded from this property.
var name = file.name;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/name
Property. Returns the name of the file represented by a `web.files.File` For security reasons, the path is excluded from this property. `var name = file.name;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/name`
(set-file-name! this val)
Property.
Returns the name of the file. For security reasons the path is from this property.
var name = instanceOfFile.fileName;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/fileName
Property. Returns the name of the file. For security reasons the path is from this property. `var name = instanceOfFile.fileName;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/fileName`
(set-file-size! this val)
Property.
Returns the size of a file in bytes.
var size = instanceOfFile.fileSize;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/fileSize
Property. Returns the size of a file in bytes. `var size = instanceOfFile.fileSize;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/fileSize`
(set-last-modified! this val)
Property.
The File.lastModified read-only property provides the last modified of the file as the number of milliseconds since the Unix epoch 1, 1970 at midnight). Files without a known last modified date the current date.
const time = instanceOfFile.lastModified;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified
Property. The File.lastModified read-only property provides the last modified of the file as the number of milliseconds since the Unix epoch 1, 1970 at midnight). Files without a known last modified date the current date. `const time = instanceOfFile.lastModified;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified`
(set-moz-full-path! this val)
Property.
A privileged exension to the web.files.File
interface, the
property contains the full pathname of the represented file.
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/mozFullPath
Property. A privileged exension to the `web.files.File` interface, the property contains the full pathname of the represented file. See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/mozFullPath`
(set-name! this val)
Property.
Returns the name of the file represented by a web.files.File
For security reasons, the path is excluded from this property.
var name = file.name;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/name
Property. Returns the name of the file represented by a `web.files.File` For security reasons, the path is excluded from this property. `var name = file.name;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/name`
(set-size! this val)
Property.
Returns the size of a file in bytes.
var size = instanceOfFile.size
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/size
Property. Returns the size of a file in bytes. `var size = instanceOfFile.size` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/size`
(set-type! this val)
Property.
Returns the media type (MIME) of the file represented by a web.files.File
var name = file.type;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/type
Property. Returns the media type (MIME) of the file represented by a `web.files.File` `var name = file.type;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/type`
(size this)
Property.
Returns the size of a file in bytes.
var size = instanceOfFile.size
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/size
Property. Returns the size of a file in bytes. `var size = instanceOfFile.size` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/size`
(slice this & args)
Method.
The Blob.slice() method is used to create a new web.files.Blob
containing the data in the specified range of bytes of the source
var blob = instanceOfBlob.slice([start [, end [, contentType]]]);
See also: https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice
Method. The Blob.slice() method is used to create a new `web.files.Blob` containing the data in the specified range of bytes of the source `var blob = instanceOfBlob.slice([start [, end [, contentType]]]);` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice`
(type this)
Property.
Returns the media type (MIME) of the file represented by a web.files.File
var name = file.type;
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/type
Property. Returns the media type (MIME) of the file represented by a `web.files.File` `var name = file.type;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/type`
(webkit-relative-path this)
Property.
The File.webkitRelativePath is a read-only property that contains
web.USVString
which specifies the file's path relative to the
selected by the user in an <input>
element with its webkitdirectory
set.
relativePath = File.webkitRelativePath
See also: https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath
Property. The File.webkitRelativePath is a read-only property that contains `web.USVString` which specifies the file's path relative to the selected by the user in an `<input>` element with its webkitdirectory set. `relativePath = File.webkitRelativePath` See also: `https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close