URLs for Rights-Managed HTML Files
This topic describes the format for a URL that refers to a rights-managed HTML file or part of a rights-managed HTML file. You can use this syntax to create a hyperlink to any MIME part of the encoded MIME Encapsulation of Aggregate HTML Documents (MHTML) within a rights-managed HTML file.
This topic contains the following sections.
- URL Syntax
- Example Usage
URL Syntax
The URL for a rights-managed HTML file, or part of a rights-managed HTML file, has the following syntax.
rmh:ReservedID!EncodedDocumentURL![EncodedMIMEPart]!DocumentURL[!MIMEPart]
DocumentURL
The document URL is the location of the rights-managed HTML file. See RFC3986: Uniform Resource Identifier (URI), Generic Syntax for a detailed description of the format of URLs.
MIMEPart
The optional MIME part references a part of the encoded MHTML body other than the main body. The MIME part must be cid: followed by the content ID of the body part to reference.
EncodedDocumentURL
The encoded document URL is a base-32 encoding of the document URL. To base-32-encode a string of characters, a binary representation of the string is split into 5-bit segments. Each segment, a binary number with a decimal value between 0 and 31, corresponds to a single digit in base 32. For this encoding, the base-32 digits are the capital letters "A" through "Z" followed by the numbers "0" through "5". The following table shows each base-32 digit and the corresponding decimal value.
Digit | Value | Digit | Value | Digit | Value | Digit | Value |
---|---|---|---|---|---|---|---|
A | 0 | I | 8 | Q | 16 | Y | 24 |
B | 1 | J | 9 | R | 17 | Z | 25 |
C | 2 | K | 10 | S | 18 | 0 | 26 |
D | 3 | L | 11 | T | 19 | 1 | 27 |
E | 4 | M | 12 | U | 20 | 2 | 28 |
F | 5 | N | 13 | V | 21 | 3 | 29 |
G | 6 | O | 14 | W | 22 | 4 | 30 |
H | 7 | P | 15 | X | 23 | 5 | 31 |
If the total number of bits in the binary buffer is not a multiple of five, the final segment does not contain a full 5 bits. Add zeros to the right side of the binary number to make a total of 5 bits before base-32 encoding.
EncodedMIMEPart
If a MIME part is specified, a base-32 encoded representation of the MIME part must also be specified.
ReservedID
This is a reserved value that is not required when specifying a URL.
Example Usage
The following examples demonstrate how to use rights-managed HTML URLs.
URL for the main body part
To reference the main body part of the rights-managed HTML file at https://www.fourthcoffee.com/budget.rmh, use the following URL.
rmh:!NB0HI2B0F2XXO31XFZTG43LSORUGG11GMZSWKLTDN3WS4YTVMRTWK3BOOJWWQ!!https://www.fourthcoffee.com/budget.rmh
Note The document URL alone is sufficient to reference the main body part of a rights-managed HTML document. The URL in the preceding example is equivalent to https://www.fourthcoffee.com/budget.rmh
.
URL for a specific body part
To reference the body part with a content ID of" income" for the rights-managed HTML file at https://www.fourthcoffee.com/budget.rmh, use the following URL.
rmh:!NB0HI2B0F2XXO31XFZTG43LSORUGG11GMZSWKLTDN3WS4YTVMRTWK3BOOJWWQ!MNUWIOTJNZRW41LF!https://www.fourthcoffee.com/budget.rmh!cid:income