The mgiEncryptURL Tag

Tag Behavior

The mgiEncryptURL tag encrypts the URL to files and streams the files to the browser for display or download. For common files, appropriate MIME types are transmitted for interpretation by the browser.


Tag Syntax

The mgiEncryptURL tag has a beginning tag with one required parameter and two optional parameters, a body, and an ending tag. The tag form is:

<mgiEncryptURL mode="Display/Link" linkText="String" linkImage="Image Path"
serverName="Server Address">
Relative Path to File 
</mgiEncryptURL>

Required Parameters:

  • mode="Display/Link" where "Display" indicates that the file is an image to be displayed in the browser and "Link" indicates that the file should be downloaded via a link. If the mgiEncryptURL tag is in "Link" mode, the linkText parameter is required.

Optional Parameters:

  • linkText="String" where "String" is the text displayed for the link to download the file (e.g., "Click here to download now"). If the linkText or linkImage parameter is not included, the default link is the string "Click Here".
  • linkImage="Image Path" where "Image Path" is the relative or absolute URL to the image that links to the download file. If the linkText or linkImage parameter is not included, the default link is the string "Click Here".
  • serverName="Server Address" where "Server Address" is the cannonical name (name.domain.com) or IP address of a remote server where the image or file resides. If a remote server is included, the body of the mgiEncryptURL must contain the path to the file beginning at the root level of the virtual address or IP number. Do not include the name of the root folder itself in the path - begin within the root folder and work down to the file. For example, if gonzo.mydomain.com points to the folder "Gonzo" at the root of WebSTAR and the file "image.gif" is in the "Gonzo" folder, then the path would be just "image.gif". If the IP address points to the WebSTAR root, then the path would be "Gonzo/image.gif". The remote server must be running a copy of MGI Server 1.5 or later.

Tag Body

  • Relative Path to File- The body of the mgiEncryptURL tag contains the relative path to the file to display or download. If the file to download is located on the same server as the page containing mgiEncryptURL, then the path is relative from the mgiEncryptURL file. If the file to download is located on a remote server, then the path should begin at the root level of the virtual address or IP number. Do not include the name of the root folder itself in the path - begin within the root folder and work down to the file.


Example Usage and Output

Image Display

<mgiEncryptURL mode="Display">
images/image14.jpg
</mgiEncryptURL>

In this example, an image resides on the same server as the page containing mgiEncryptURL. The path to "image14.jpg" is encrypted and the image is streamed to the browser and is displayed at the location of the mgiEncryptURL tag. In the source view of the browser, the path to the image might look like the following:

mgiEncryptURL.mgifs$path=4E09140F1B3E1A001A0419020919044A0B0008011D0004010

File Download and Stream

<mgiEncryptURL mode="Link" linkText="Download Your Software Purchase Here">
downloads/v15/dragonslayer.hqx
</mgiEncryptURL>

In this example, a software file resides on the same server as the page containing mgiEncryptURL. The path to the file "dragonslayer.hqx" is encrypted and the file is streamed to the browser. Since the .hqx suffix is likely mapped in the browser for a particular application, the file is downloaded and opened by the application.

Remote File Download and Stream

<mgiEncryptURL mode="Link" linkText="Download Your Software Purchase Here" 
serverName="downloads.domain.com">
powersoftware/downloads/v15/dragonslayer.hqx
</mgiEncryptURL>

In this example, a software file resides on a remote server (in the folder structure WebSTAR Root/powersoftware/downloads/v15/dragonslayer.hqx). The address "downloads.domain.com" is mapped to the WebSTAR Root folder therefore the required path structure is "powersoftware/downloads/v15/dragonslayer.hqx". The path to the file "dragonslayer.hqx" is encrypted and the file is streamed to the browser by the remote server (Note: the remote server must be running a copy of MGI Server 1.5 or later).


Suggested Usage

  • Online Image and File Purchases
  • File Protection


[Return to the Referencing MGI Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]