File considerations

The following considerations apply to using the iSeries™ Access for Web file functions in a Web application server environment.

Content-type (MIME-type) mapping

iSeries Access for Web uses the file extension to determine the file content-type (MIME-type). The file content-type is used by the browser to determine how best to render the information. For example, files with an extension of .htm, .html, or .txt are rendered in the browser window. The browser will also attempt to determine what browser plug-in to use for the given file content-type. A file with a .pdf extension will cause the browser to attempt to load the Adobe Acrobat Reader.

iSeries Access for Web provides a way to extend or override the included file extension to file content-type mapping. These overrides are done on an instance basis. For each Web application server (WebSphere® and ASF Tomcat) instance for which iSeries Access for Web is configured, you can override the included file extension content-type mapping.

To override the included mappings, create a file called extension.properties and place the file in the integrated file system at one of the following locations:

An example is provided at /QIBM/ProdData/Access/Web2/config/extension.properties that you can copy to your UserData tree.

For application_server, specify:

For instance_name, specify the name of the Web application server instance in which iSeries Access for Web was configured. This Web application server instance was specified on the QIWA2/CFGACCWEB2 command when you configured iSeries Access for Web.

Start of changeFor server_name, specify the name of the application server within the Web application server instance in which iSeries Access for Web was configured. This application server was specified on the QIWA2/CFGACCWEB2 command when you configured iSeries Access for Web. End of change

Some examples of extension.properties entries are:

Start of changeFor a list of file content-types, see the Internet Assigned Numbers Authority Mime Media Types Web page.End of change

Start of change

Forcing a Save As window when downloading files

When using Microsoft® Internet Explorer and any of the iSeries Access for Web functions to download a file to the browser, many times Internet Explorer will display the file's content in the browser without offering an opportunity to just save the file. Basically, Internet Explorer examines the data in the file and determines that it can display the data in the browser window. Many users do not want this behavior and would prefer to save the file immediately.

To get around this issue, iSeries Access for Web can now optionally write a HTTP header that forces Microsoft Internet Explorer and other browsers to display a File Save As window. The HTTP header being written is a Content-Disposition header. The Content-Disposition header that can be written is controlled by creating a disposition.properties file. Different Content-Disposition headers can be written based on the file content-type (MIME-type) being downloaded.

iSeries Access for Web uses the file extension to determine the file content-type (MIME-type) to be sent to the browser. The file content-type is used by the browser to determine how best to render the information. For more information about controlling the MIME-type based on the file extension, see Content-type (MIME type) mapping in this topic. This topic describes how to map file extensions to different MIME-types.

Once the MIME-type mapping setup has been done, you need to create a disposition.properties file in the iSeries Access for Web UserData tree. For most of the supported Web serving environments, the iSeries Access for Web UserData tree is /QIBM/UserData/Access/Web2/application_server/instance_name/server_name/config. Replace application_server, instance_name, and server_name with the unique values on your server.

The disposition.properties file needs to contain entries that specify which Content-Disposition header value should be written, based on the MIME-type of the file being downloaded using iSeries Access for Web.

The following sample properties files give an example of what would be required to force a File Save As window when downloading a file with a .TXT extension:

Example:

The extensions.properties file needs to contain: txt=text/plain

The disposition.properties file needs to contain: text/plain=attachment

Changes to the properties file will take effect shortly after the files are changed. The changes do not take effect immediately unless the Web application server is stopped and restarted.

End of change

Document Library Services (QDLS) file system enrollment

A user must be enrolled in the system directory in order to access the Document Library Services (QDLS) file system with iSeries Access for Web. The steps needed to enroll a user are listed below. If the user has previously been enrolled or does not need access to the QDLS file system, these steps are not necessary. A user can still use the File function of iSeries Access for Web without having access to the QDLS file system.
  1. Enter GO PCSTSK at the iSeries command prompt. This display screen is shown:
    Figure 1. Client Access Tasks (GO PCSTSK)
    #
    
    +----------------------------------------------------------------------+
    | PCSTSK                     Client Access Tasks                       |
    |                                                   System:   SYSTEM1  |
    | Select one of the following:                                         |
    |                                                                      |
    |   User Tasks                                                         |
    |      1. Copy PC document to database                                 |
    |      2. Copy database to PC document                                 |
    |                                                                      |
    |   Administrator Tasks                                                |
    |     20. Work with Client Access administrators                       |
    |     21. Enroll Client Access users                                   |
    +----------------------------------------------------------------------+
  2. Select the Enroll Client Access Users option. This display screen is shown:
    Figure 2. Enroll Client Access Users display
    +----------------------------------------------------------------------+
    |                         Enroll Client Access Users                   |
    |                                                                      |
    |Type choices, press Enter.                                            |
    |                                                                      |
    |  User profile . . . . . . . .   AARON              Name              |
    |  User identifier:                                                    |
    |    User ID  . . . . . . . . .   AARON              Character value   |
    |    Address  . . . . . . . . .   SYSTEM1           Character value    |
    |  User description . . . . . .   AARON B.                             |
    |  Add to system directory  . .   *NO               *NO, *YES          |
    +----------------------------------------------------------------------+
  3. Enter the appropriate information for these values:
    User profile
    Name of user
    User ID
    Usually the same as the User profile name
    User address
    Usually the same as the system name
    User description
    A description of the user
    Add to system directory
    Use *YES if you want to use the QDLS file system
    See the online help for a complete description of the entry fields.
  4. Repeat the above steps to enroll other users in the Directory Entry Database.