Initializing help system before first use

# Attachment

Contains information about a scenario or app attachment. See scenario.getScenarioAttachments().

### 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

async download ( waitForDownload ) → {void}

  Downloads this attachment. Depending on browser settings, this may prompt the user to choose where to save. Optionally waiting for the file to be fully fetched before initiating the download.

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  waitForDownload | boolean | optional | false | If `true`, the function fetches the file and converts it to a Blob before downloading. If `false`, the function initiates the download directly using the data URL.

  Returns:

  Type | Description
  --- | ---
  void |

  ##### Examples

      // Download the attachment directly using the data URL
       attachment.download();

      // Fetch the file and process it as a Blob before downloading
       await attachment.download(true);

  Back to Top
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

      var url = attachment.getDataUrl();

  Back to Top
getDescription ( ) → {string}

  Returns the description of the attachment.

  Returns:

  Type | Description
  --- | ---
  string | The description of the attachment

  ##### Example

      var description = attachment.getDescription();

  Back to Top
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 editor
  Returns:

  Type | Description
  --- | ---
  AttachmentEditor | Attachment Editor object. Returns editor with the same id as editorId or first editor, when editorId is not specified.

  ##### Example

      var attachmentEditor = attachment.getEditor();

  Back to Top
getFilename ( ) → {string}

  Returns the filename for this attachment.

  Returns:

  Type | Description
  --- | ---
  string | The filename for this attachment

  ##### Example

      var filename = attachment.getFilename();

  Back to Top
getId ( ) → {string}

  Returns the unique ID for this attachment.

  Returns:

  Type | Description
  --- | ---
  string | The ID representing this attachment

  ##### Example

      var id = attachment.getId();

  Back to Top
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

      var date = attachment.getLastModifiedDate();

  Back to Top
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

      var userId = attachment.getLastModifiedUserId();

  Back to Top
getSize ( ) → {number}

  Returns the size of the attachment data.

  Returns:

  Type | Description
  --- | ---
  number | The size in bytes of the attachment data in bytes.

  ##### Example

      var size = attachment.getSize();

  Back to Top
getTags ( ) → {Array.<string>}

  Returns the tags applied to this attachment.

  Returns:

  Type | Description
  --- | ---
  Array.<string> | An array of tag names

  ##### Example

      var tags = attachment.getTags();

  Back to Top
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

      var hasEditor = attachment.hasEditor();

  Back to Top
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

      attachment.openProperties('filename');

  Back to Top

Parent Topic Classes

© 2001-2026 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.