Initializing help system before first use

# insightputscenattach

Purpose
Uploads an attachment for the current scenario to the Insight server
Synopsis
`procedure insightputscenattach(attachname:text)`
`procedure insightputscenattach(attachname:text, filename:text)`
`procedure insightputscenattach(attachname:text, overwrite:boolean)`
`procedure insightputscenattach(attachname:text, filename:text, overwrite:boolean)`
Arguments

attachname | The name of the attachment to be uploaded
filename | The local file from which to read the attachment data. If not specified, attachment name will be used.
overwrite | If true, will overwrite attachment if it already exists. If false and attachment already exists, will fail with insightattachstatus INSIGHT_ATTACH_ALREADY_EXISTS. Defaults to true if not given.

Example

    insightputscenattach('myattach.dat',false)
    if insightattachstatus=INSIGHT_ATTACH_OK then
      writeln("Attachment added ok")
    elif insightattachstatus=INSIGHT_ATTACH_ALREADY_EXISTS then
      writeln("Attachment already exists")
    else
      writeln("Error adding attachment")
    end-if

Example of taking a file myattach.dat in the working directory, and saving it as a new scenario attachment called myattach.dat.

    insightputscenattach('myattach.dat','prices/mydata.dat')
    if insightattachstatus=INSIGHT_ATTACH_OK then
      writeln("Attachment added ok")
    else
      writeln("Error adding attachment")
    end-if

Example of taking a file prices/mydata.dat, and saving into a scenario attachment called myattach.dat.
Further information
1. Check the attachment status code using insightattachstatus to determine whether the attachment was successfully added.
2. filename can be an existing file in the work directory, or include a directory path, or an extended Mosel filename such as 'text:varname' or 'zlib.gzip:filename.txt'.
3. The new or updated attachment will not be available on the Insight server until the scenario completes.
4. The attachment will always be updated on the current scenario; it is not possible to update attachments of other scenarios.
5. Attempting to access attachments when the model is not being run through Xpress Insight will cause the model to abort with an error, except when test mode has been activated by setting insight_testmode.
Related topics
insightattachstatus insightgetscenattach
Parent Topic Attachments

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