How do you implement attachments in APM using URLs (Universal Resource Locators)?
search cancel

How do you implement attachments in APM using URLs (Universal Resource Locators)?

book

Article ID: 26308

calendar_today

Updated On:

Products

CA IT Asset Manager CA Software Asset Manager (CA SAM) ASSET PORTFOLIO MGMT- SERVER CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

How do you implement attachments in APM using URLs (Universal Resource Locators)?

 

 

Environment

Asset Portfolio Management 17.x

Resolution

How to Specify a URL for an attachment

A URL address is always of the form: http[s]://ServerName/VirtualDirectoryName/FileName.ext. To specify an attachment by URL follow these steps:

  1. From the APM Home Page, select the object type you wish to add an attachment to (Asset, Model, Contact, Location, Company, Legal Document, or Organization). Note that you cannot add an attachment to a Site.

  2. Use Basic or Advanced Search to select a specific object of that type.

  3. In the left tree view, expand Attachments for <object>

  4. Select <New>

  5. The Attachment window will open in the right pane.

  6. For Attachment Type, select URL.

  7. The Attachment window will change to display the fields available for URL attachment types.

  8. The optional text you enter in the Description field will be prepended to the URL address and appear in the list of attachments in the attachments list tree in the left pane after you have saved the attachment. Entering a brief description will make it easier for users to identify the purpose of the attachment. Without it, users will have to decipher the URL to determine the nature of the attachment.

  9. The File Path field is required. Enter the complete URL address to the attachment in the form: http[s]://<ServerName>/<VirtualDirectoryName>/<FileName.Ext>.

    1. You will receive an error if the File Path does not begin with http:// or https://.

    2. You can specify local HTTPS addresses here if your IIS Server has been configured to serve SSL pages.

    3. You can enter addresses outside your local domain such as http://www.broadcom.com.

    4. APM does not attempt to validate the address you enter. You can enter a file name that does not yet exist and copy it to this location later using Windows Explorer, if desired.

  10. If the attachment file already exists at the File Path location you entered, you can use the View button to test the attachment before selecting Save.

  11. Click the Save button after entering all information. You will receive the message "Confirmation: The save has completed successfully" if there are no errors.

  12. The new attachment will appear in the left pane tree view under Attachments for <object> in the form: <Description> - <http[s]://Address/File.Ext>

Once you have saved an attachment in APM, it is not possible to modify the entry. If you need to change the description or URL for an attachment after it has been saved, you must delete the attachment from APM and create a new one incorporating the changes. Note that deleting an attachment from APM does not delete the actual file - only the entry for it in APM.

How to Implement Attachments in IIS 6.0

Without doing any special configuration in IIS you can specify internet URLs as attachment paths and use these to display web pages from other sites. If your users have permission to access the Internet from within your corporate firewall, then they can view attachments that are actually web pages from external sites. For instance, you can create an attachment of http://www.broadcom.com, and users will see the CA home page when they open the attachment.

When attachments are specified by a local URL on your server or any other server in your local domain, you cannot view them until they are "served" to the user in exactly the same way as pages on a web site. Even attachments which are not html, xml, or other browser-type files are opened for the user using the same rules as web sites. This means that in order to view attachments stored on a server in your local domain, you must configure IIS to serve the files, and you must configure both IIS and NTFS file permissions to allow your users to view the attachments.

A Simple Example

IIS is capable of serving files located on the local IIS server, remote servers located in your domain, and even servers located in other domains. This article discusses the steps you need to take to serve files co-located on your IIS server so that APM users can view attachments stored by URL address.

Create a folder to contain your attachment files

  1. In Windows Explorer, create a new folder called "AttachmentsFolder"

    1. C:\AttachmentsFolder

  2. Right-Click on this folder and select Sharing and Security

    1. In the Sharing tab, select Share this folder with Share name AttachmentsFolder

    2. Click the Permissions button and grant Everyone Full Control

  3. Select the Security tab

    1. Select the group Users (<ServerName>\Users)

    2. Grant Full Control

  4. Click OK to save these settings

Configure IIS to serve your attachment files

  1. As the local administrator, Open IIS Manager

    1. Start, All Programs, Administrative Tools, Internet Information Services (IIS) Manager

    2. Expand <Server Name> (Local Computer)

    3. Expand Web Sites

    4. Select Default Web Site

      1. Right-Click Default Web Site

      2. Select New

      3. Select Virtual Directory

    5. The Virtual Directory Creation Wizard will open

    6. Click Next

    7. You will be prompted to enter an Alias name. Enter attachments

    8. This will be the name of your new Virtual Directory in IIS.

    9. Click Next

    10. For Path, browse to or type in the directory you created to hold attachments

      1. C:\AttachmentsFolder

      2. Do not enter a mapped network drive. IIS does not support using mapped drives for Virtual Directories.

      3. Click Next

    11. Virtual Directory Access Permissions, allow the following permissions:

      1. Select Read

      2. Do not select Run scripts, Execute, Write, or Browse

      3. Click Next to complete the wizard.

    12. You should see, You have successfully completed the Virtual Directory Creation Wizard.
      1. Click Finish.

In IIS Manager you should now see an entry for your new virtual directory Attachments under Default Web Site

Test the Virtual Directory

  1. Go back to Windows Explorer and copy some files into C:\AttachmentsFolder, or create a new file with Notepad in this folder named Test.txt and save it.

  2. Return to IIS Manager and refresh the page.

  3. You should see the new files appear in the Attachments virtual directory automatically.

  4. In Windows Explorer, create a new folder inside C:\AttachmentsFolder.

  5. C:\AttachmentsFolder\Folder2

  6. Create the new file test2.txt in Folder2 and save it.

  7. Return to IIS Manager and refresh the page.

  8. You should see the new folder you created and the new file you put in it.

  9. Open Internet Explorer browser.

  10. In the address bar enter YourServerName/Attachments/test.txt

  11. You should see your test.txt file displayed in the browser window.

  12. In the address bar enter YourServerName/Attachments/Folder2/test2.txt

  13. You should see the file test2.txt displayed in the browser window.

  14. In APM, create a new URL attachment for any object.

  15. For File Path enter http://<YourServerName>/Attachments/Folder2/test2.txt

  16. Click the View button.

  17. The file test2.txt should be displayed in the browser window.

Further Reading

To learn more about securing attachments in APM and limiting which users can view them, see How To Implement Attachments in a Secure Environment, available on this web site.