Binary File rules - Completing the Main tab
Create a binary file rule to include a graphics file, such as an image (including GIF, JPG, or PNG files) or other non-text files in your application as a rule. This rule type provides the security, inheritance versioning, and deployment benefits of rule resolution to a file.
- Upload and embed a binary file (such as an image) from your workstation or network into the rule instance.
- Download a binary file from the rule instance to your workstation.
Field | Description |
---|---|
Relative Path |
Optional. Enter a subdirectory of the Web server directory identified by the
first key part of the instance. Enter
|
Image Preview | |
Image Preview |
When the file type is an image, the form contains a preview of the image and
indicates the width and height of the image in pixels.
In some situations, your browser may present a stale version of the image. Follow the notes below on clearing the cache. |
Sprite | |
Treat Image as a Sprite |
Select to indicate that the image is a sprite, which you can use in a
pxIcon
control rule. The sprite must be a grid comprising three
rows and any number of columns. Each column contains an icon to indicate a control's
state (from top to bottom):
Here is an example:
Because a sprite is a central image composed of numerous images positioned differently across multiple CSS declarations, loading an image occurs once. In the CSS, the system uses a specified portion of the image instead of a set of individual images. Using sprites accelerates load time due to fewer HTTP server requests. See the Icon (for image) option in Control form — Completing the Control tab. |
Icon Width | Enter the pixel width of each icon in a single state (not the width of the entire image). |
Icon Height | Enter the pixel height of each icon in a single state (not the height of the entire image). |
Upload File | Click to upload into this rule a binary file on your workstation or local area network. |
Download File | Click to download the binary file associated with this rule to your workstation or local area network. |
To upload an image or other binary file
To upload an image file from your workstation into a binary file rule instance:
- Click Upload File to navigate to the file on your workstation or network.
- Locate the file, and click Upload File. A message box confirms when the upload completes.
- Save the binary file rule.
References to images
You can reference binary file rule images in HTML for display or for correspondence using standard HTML syntax:
<IMG SRC="images/myImage.jpg">
The system automatically extracts the image from the rule into a static directory used by the Tomcat (or other) Web server. It converts the relative path you provide in HTML to the true path that provides the RuleSet version-specific copy of the image.
To download an image or other binary file
You can extract an image or other file from the binary file rule to your workstation. After the image file is on your workstation, you can display or update it using image editing software:
- Click Download File.
- Indicate where the system is to place the output file.