Skip to main content
Kinetic Community

Attachment Download Module

The Kinetic Request Attachment Download Module is a package that provides functionality necessary to download files stored in BMC® Remedy® attachment field values.  It is most often used by Kinetic Request bundles to allow technicians access to file attachments stored in related systems (such as ITSM Incident Work Log attachments, etc).

Requirements

The Kinetic Request Attachment Download Module requires Kinetic Request v5.1.1 or Kinetic Request v5.1.2.

Additionally, the Attachment Download Module uses the built in Remedy permissions, and can only be accessed by users that have authenticated with Kinetic Request.

Installation

Installation of the Attachment Download Module requires that the kinetic-request-attachment-download.jar file is added to the Kinetic Request web application, the Kinetic Request web.xml file is modifed to expose the AttachmentDownloadServlet, and the web application is restarted.

Before beginning, download the attached kinetic-request-attachment-download.jar file.

  1. Copy the kinetic-request-attachment-download.jar file into the Kinetic Request web application WEB-INF/lib directory.
  2. Open the Kinetic Request web.xml file stored in WEB-INF and add the highlighted snippits.
        ...
        <servlet>
            <servlet-name>CacheManager</servlet-name>
            <servlet-class>com.kd.ksr.servlets.CacheManager</servlet-class>
        </servlet>
        <servlet>
            <servlet-name>DownloadAttachmentServlet</servlet-name>
            <display-name>Download Attachment Servlet</display-name>
            <description>Provides access to attachment files.</description>
            <servlet-class>com.kd.ksr.servlets.DownloadAttachmentServlet</servlet-class>
        </servlet>
        <servlet>
            <servlet-name>PerformanceManager</servlet-name>
            <servlet-class>com.kd.ksr.servlets.PerformanceManager</servlet-class>
        </servlet>

        ...
        <servlet-mapping>
            <servlet-name>CacheManager</servlet-name>
            <url-pattern>/CacheManager</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>DownloadAttachmentServlet</servlet-name>
            <url-pattern>/DownloadAttachment/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>PerformanceManager</servlet-name>
            <url-pattern>/PerformanceManager</url-pattern>
        </servlet-mapping>
        ...
  3. Reload the Kinetic Request web application.  This is most easily done by restarting the web server that is running Kinetic Request.

Usage

To use the Attachment Download Module, simply pass the form name, field id, and request id on a URL formatted similar to:

http://SERVER:PORT/kinetic/DownloadAttachment/FORM_NAME/ATTACHMENT_FIELD_ID/REQUEST_ID

For example, the following URL is a link to the Kinetic Task handler attachment record (stored in attachment field 700001017 on the KS_TSK_Def form) associated to the entry with a request id of 000000000000006.

http://SERVER:PORT/kinetic/DownloadAttachment/KS_TSK_Def/700001017/000000000000006 

Errors

Any errors that occur, such as an unauthenticated user attempting to access the attachment download functionality or the specified form/field/record not existing will be included in the standard kslog.log file accessible in the Kinetic Request AdminConsole.

Advanced Usage

The Attachment Download Module supports an optional disposition parameter.  This parameter can be used to specify whether the attachment should be opened inline (IE in the browser window) or downloaded.

As an example, the following will display the "Power by Kinetic" logo in a browser tab:

http://SERVER:PORT/kinetic/DownloadAttachment/KS_ACC_Attachment/700000001/000000000000006?disposition=inline

while the following would force the file to be downloaded directly:

http://SERVER:PORT/kinetic/DownloadAttachment/KS_ACC_Attachment/700000001/000000000000006

Special Instructions

Downloading Office/PDF documents over HTTPS

There is a known Internet Explorer bug that prevents Office and PDF documents from being downloaded over HTTPS when the Cache-Control header is set (for more information, see: http://support.microsoft.com/kb/812935).

As a workaround for this issue, the Attachment Download Module provides an optional nocache parameter.  If the attachment download request includes this nocache parameter, the Attachment Download Module will not include the Cache-Control header.  The nocache parameter should be set to an automatically changing value to ensure that caching does not occur.

Hers is an example of the formatted request:

http://SERVER:PORT/kinetic/DownloadAttachment/KS_TSK_Def/700001017/000000000000006?nocache=1380658100516

If you are using the Attachment Download Module with Kinetic Request bundles, you can generate a URL like this using code similar to:

/**
*  @param Attachment
*  @return string
*/
public static String buildAttachmentUrl(Attachment attachment) {
    return "DownloadAttachment/"+attachment.getFormName()+"/"+attachment.getFieldId()+"/"+attachment.getRequestId()+"?nocache="+System.currentTimeMillis();
}

Changelog

v1.3.0 (2015-12-02)

  • Fixes a bug where Remedy forms with spaces or other characters which required URL encoding did not work.

v1.2.0 (2015-01-05)

  • Changes behavior to display a "No file found." message rather than raising an error if the attachment field is null.

v1.1.0 (2013-10-01)