Using Relative Links In ASX Files

Relative links are a fully supported feature of Microsoft® NetShow™ ASX metafiles. You can use relative links in ASX files similar to how you use them in Hypertext Markup Language (HTML) documents. The use of relative links allows you to create ASX files which are portable, meaning you can copy or move an entire directory structure to another server without updating the paths to graphic files used as Logos or Banners or the Href attributes of MoreInfo elements (if on the same Web server as the stored ASX file). It is important to remember that relative links, in any application that supports them, work because the parts of the Uniform Resource Locator (URL) you do not include in the Href attribute of an element do get included in the URL sent by the application to the server when the URL is requested. This means that the protocol (such as Hypertext Transfer Protocol [HTTP]), the server name, and the virtual directory the file containing the relative link is located in are included in the URL sent to the server. If the file, media, or URL you link to using a relative link do not reside on the same server as the ASX file the relative link is not valid.

You can use relative links in an ASX file by creating a simple ASX file in version 1.0 ASX syntax which contains a link to another ASX file in 3.0 syntax. All metadata (Title, Author, Copyright etc.) displayed in the player is read from the second ASX file. You can use links (values of Href attributes) in the second ASX file which are relative to that ASX file (meaning the location from where the file was opened), similar to using relative links in a Web page. All relative links in the version 3.0 ASX file must be fully relative rather than drive relative, meaning that you cannot use a relative link that begins with a "\" character. When an URL begins with a "\" character the link is drive relative, which causes the player to attempt to open the file linked to on the drive the ASX file was opened from. Because Web servers use virtual directories, the player tries to find the file in a subdirectory of a virtual directory. Even if the path happened to be valid, a user would not have rights to access the physical directory on that Web server.

You can use drive relative links when using ASX files on a single computer where all files linked to in the ASX file exist on a storage device in that computer. However, you cannot stream media in this manner.

© 1996-1998 Microsoft Corporation. All rights reserved.