Attachment
Method summary
name | description |
---|---|
download | Downloads this attachment. |
getDataUrl | Returns a URL where the attachment data can be downloaded from. |
getDescription | Returns the description of the attachment. |
getEditor | Returns the editor details for the attachment. |
getFilename | Returns the filename for this attachment. |
getId | Returns the unique ID for this attachment. |
getLastModifiedDate | Returns the date/time when the last modification of the attachment data took place. |
getLastModifiedUserId | Returns the ID of the last user to modify the attachment data. |
getSize | Returns the size of the attachment data. |
getTags | Returns the tags applied to this attachment. |
hasEditor | Returns the editor details for the attachment. |
openProperties | Opens the file attachments dialog showing the properties of this attachment. |
Methods
- download ( )
-
Downloads this attachment. Depending on browser settings, this may prompt the user to choose where to save the file, or save it automatically.
Example
Back to Topattachment.download();
- getDataUrl ( ) → {string}
-
Returns a URL where the attachment data can be downloaded from.
Returns:Type Description string The relative path to download the attachment data Example
Back to Topvar url = attachment.getDataUrl();
- getDescription ( ) → {string}
-
Returns the description of the attachment.
Returns:Type Description string The description of the attachment Example
Back to Topvar description = attachment.getDescription();
- getEditor ( editorId ) → {AttachmentEditor}
-
Returns the editor details for the attachment.
Parameters:
Name Type Argument Description editorId insight.enums.EditorType optional id of the editor to retrieve Throws:
Will throw an error if attachment doesn't have a requested editorReturns:Type Description AttachmentEditor Attachment Editor object. Returns editor with the same id as editorId or first editor, when editorId is not specified. Example
Back to Topvar attachmentEditor = attachment.getEditor();
- getFilename ( ) → {string}
-
Returns the filename for this attachment.
Returns:Type Description string The filename for this attachment Example
Back to Topvar filename = attachment.getFilename();
- getId ( ) → {string}
-
Returns the unique ID for this attachment.
Returns:Type Description string The ID representing this attachment Example
Back to Topvar id = attachment.getId();
- getLastModifiedDate ( ) → {Date}
-
Returns the date/time when the last modification of the attachment data took place.
Returns:Type Description Date The last modified time Example
Back to Topvar date = attachment.getLastModifiedDate();
- getLastModifiedUserId ( ) → {string}
-
Returns the ID of the last user to modify the attachment data.
Returns:Type Description string The User ID of the modifying user Example
Back to Topvar userId = attachment.getLastModifiedUserId();
- getSize ( ) → {number}
-
Returns the size of the attachment data.
Returns:Type Description number The size in bytes of the attachment data in bytes. Example
Back to Topvar size = attachment.getSize();
- getTags ( ) → {Array.<string>}
-
Returns the tags applied to this attachment.
Returns:Type Description Array.<string> An array of tag names Example
Back to Topvar tags = attachment.getTags();
- hasEditor ( editorId ) → {boolean}
-
Returns the editor details for the attachment.
Parameters:
Name Type Argument Description editorId insight.enums.EditorType optional id of the editor to retrieve Returns:Type Description boolean When editorId is specified, returns true if attachment has an editor with specified id, otherwise returns false. When editorId is not specified, returns true if there's any editors available, otherwise returns false Example
Back to Topvar hasEditor = attachment.hasEditor();
- openProperties ( propertyName )
-
Opens the file attachments dialog showing the properties of this attachment. If propertyName is provided then the edit mode will be activated for that property of the attachment.
Parameters:
Name Type Argument Description propertyName optional the name of a property to edit ('filename', 'description' or 'tags') Example
Back to Topattachment.openProperties('filename');
© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.