IMAGE attribute

The IMAGE attribute defines the image resource to be displayed in the form item.

Syntax

IMAGE = "resource"
  1. resource defines the name or path to the image source.

Usage:

The IMAGE attribute is used to define the image resource to be displayed form items such a BUTTON , BUTTONEDIT, a TOOLBAR button or a static IMAGE item.

The resource string can be one of the following:

  1. A simple file name (with or without extension), using a relative or an absolute path.
  2. A path to an image on a server in the URL (Uniform Resource Locator) form.

It is recommended that you use simple image file names without the file extension, and define the FGLIMAGEPATH environment variable to centralize image files on the application server in a directory created specifically for images. For portability reasons, use .png or .svg image file formats only.

Possible image file formats

According to the front-end type, some image file formats or image data formats might not be supported.
Table 1. Image file formats supported by different front-ends
Suffix (case insensitive) Front-ends supporting the file format
.BMP GDC, GWC
.GIF GDC, GWC
.ICO GDC, GWC
.JPG GDC, GWC
.PNG GDC, GWC
.SVG GDC, GWC
.TIFF GDC, GWC

Using file names or paths

If the image specification is a simple string without an URL or URI prefix, it is identified as a file path. The file is first sought in the picture directory on the client workstation. According to the front-end type, this local directory can actually be on a remote machine where the GAS middle-ware component is located. If the file is not found, the front-end automatically sends an image request to the runtime system, in order to search for an image on the server where the programs are executed. The runtime system searches for server-side images by using the FGLIMAGEPATH environment variable. If FGLIMAGEPATH is not set, the image files are searched in the current working directory.

Important: By default, if FGLIMAGEPATH is not set, the image files are searched in the current working directory. Image filenames can use absolute or relative paths and the whole application server file system can be searched (according to the permissions of the operating system user running the fglrun process). This can be a security hole because fake front-ends could ask for critical server files that are not images.

When setting FGLIMAGEPATH , the runtime system will only transfer files found in the directories listed in that environment variable. You can still use absolute or relative paths in the image file names, but the files must be located below one of the directories listed in FGLIMAGEPATH. For maximum security, put the image files in directories that contain only image files, and keep critical data or program file in separate directories.

Images displayed by the program to IMAGE fields do not follow the FGLIMAGEPATH security restriction. Image fields do not use the IMAGE attribute. For these fields, the image is specified in the field value.

Using an image server with URL names

If the image specification starts with a URL prefix, the front-end will try to download the image from the location specified by the URL.

Table 2. Supported image resource locations (URLs)
Image resource location (URL) Description
http://location-specification HTTP server
https://location-specification HTTPS server (HTTP over SSL)
ftp://location-specification FTP server
BUTTONEDIT f001 = FORMONLY.field01, IMAGE = "zoom";
BUTTON b01: open_file, IMAGE = "buttons/fileopen";
BUTTON b02: accept, IMAGE = "http://myserver/images/accept.png";