File interface represents a file stored and managed by the platform’s file store.
The digest of the file, as a hex encoded
The size of the file, in bytes, as a number.
The MIME type of the file, as set by the browser when the file was originally uploaded. Note that some MIME types are standardised as browsers tend to be a bit inconsistent.
The filename of the file, as set by the browser when the file was originally uploaded.
Note that if a file is uploaded again, it’s still only stored once, and the original filename isn’t changed. Users can use a different filename by using a
The filename of the file, without the file extension.
Date when the file was originally uploaded for the first time.
Create a new
FileIdentifier which refers to this file, with a random
The file’s secret, as a
String. You must always check the secret with the
Compare the given secret with the file’s secret using a timing-attack resistant comparison algorithm. If the secret does not match, an exception is thrown.
Read the contents of the file, interpreted as a string in the given character set, eg
Use this function with care, checking the
fileSize property before calling it, as it is very easy to accidently run out of memory.
Object, as a dictionary, containing additional properties of the file. These may not be available either because the file has not been processed yet, processing encountered an error, or the properties are not applicable to that file type.
numberOfPages: Number of pages in the file.
dimensions: Physical dimensions of the document represented by the file, with keys
thumbnail: The size of the thumbnail, if available, with keys
Return a URL which can be used to download this file. See below for the optional
Return some HTML which can be included in a web page. See below for the optional
||Transform to be applied to the file||
||Whether to include the hostname in the URL||
||Sign the URL to bypass the usual file download authentication. Note that this signature is only valid for the current user session.||
|Sign the URL to bypass the usual file download authentication. The signature doesn’t need a user session, but is only valid for the specified number of seconds.||
||When generating HTML, include a link to download the file.||
||Set the Content-Disposition to attachment to force the browser to download the file, rather than displaying it.||
BinaryData object of the thumbnail image for this file, if available. Use the
properties of the
File to determine the existence, width and height of the image.
Object-like dictionary of short
String key value pairs, intended for storing additional properties about the file such as extended file information captured by external file preservation systems.
tags property. Call with an
Object dictionary of
String key value pairs. If a value is
undefined, the tag is deleted.
Changing tags is performed atomically without race conditions for multiple concurrent modifications to tag.
An exception will be thrown if keys or values are not