Related Topics . . Home


Retrieving Large Objects

Universal Web Connect enables you to retrieve large objects from a database by setting variables to uniquely identify an object within a table.

To retrieve a large object from a table in any database to which a connection has been established, specify the variables that uniquely identify the object. The following table lists the variables used to identify a large object.
Variable Mandatory?

Content

MItabObj Yes Specifies the name of the database table in which Web application large objects are stored.
MIcolObj Yes Specifies the name of the column that contains large objects in the MItabObj table.
MInamObj Yes Specifies the name of the column that identifies the appropriate row of the MItabObj table.
MIvalObj Yes Specifies the value to check against the MInamObj column to identify the row you want to retrieve in the MItabObj table.
MItypeObj Yes Specifies the MIME type and subtype used to export the large object.
MIconnObj No Specifies the name of the connection to use to retrieve the large object.

You can set default values for all variables except MIvalObj and MIconnObj in the wcconfig.std file. For example, the following configuration file provides settings for all of the preceding variables except MIvalObj:

APP wcdaemon.exe 
MI_WEBBINDIR   $INFORMIXDIR\bin
MI_WEBWORKDIR  $INFORMIXDIR\bin 
MI_DATABASE    database@server # database@server
MI_USER        user            # database user 
MI_PASSWORD    password        # database user password
MItab          webPages        # table that contains AppPages 
MIcol          object          # blob column that contains AppPages 
MInam          ID              # column that contains unique identifiers for AppPages
MIval          apb             # default identifier 
MItabObj       webImages       # default table that contains large objects 
MIcolObj       object          # blob column that contains large objects 
MInamObj       ID              # column that contains unique identifiers for large objects 
MItypeObj      image/gif       # default content-type to send back for large objects 
ENDAPP

You can override the default values for the variables in the URL to retrieve the large object. For example, you can specify the URL for a JPEG image stored as a large object within the database identified as videodb in an MICONNECTION tag as follows:

http://myhost:port/ifmx-bin/wcdrvr.exe/wcdaemon.exe?MIvalObj=video_logo&MIconnObj=videodb

The following logo1 AppPage retrieves an image from the webImages table stored in the stores7 database:

  <HTML>
  <HEAD><TITLE>Logo Page</TITLE></HEAD>
  <BODY>
  <H3>Retrieve the APB Logo from the stores7 Database</H3>
  <HR>
  <?MICONNECTION NAME="conn1" SERVER="stores7@ol_myserver_name"
     USER="informix" PASSWORD="informix">
  <IMG 
     SRC=<?MIVAR>$WEB_HOME<?/MIVAR>?MIvalObj=logo1&MItypeObj=image/gif&MIconnObj=conn1>
  <!---If calling this page from a UWC AppPage    ---!>
  <!---you need to reconnect to the UWC database  ---!>
  <?MICONNECTION NAME="APP_PAGES">
  </BODY>
  </HTML>

The following is sample Web browser output for the logo1 AppPage.

Related Topics

Using Variables and Variable Expressions in AppPages


Top of Page . . Home