Skip to content

Get

Returns the file information by its ID.

1
myFiles.Get(id: string):FileInfo

Parameters

string id
    The ID of the file.

Returns

An instance of FileInfo if found; otherwise, null.

Remarks

If the id parameter is not a GUID value, an Error is thrown.

Examples

Check the type of an uploaded file

1
2
3
4
5
var file = $Files.Get($Xml.Evaluate('Attachment'));

if (file && file.MimeType !== 'application/pdf') {
    throw new Error('Only PDF files are accepted: ' + file.Name);
}

See Also