Blob Server Module by Automation Professionals
E-Mail Support

Blob Server Module

Overview

The Blob Server Module provides a simple way to deliver images, PDF files, or other binary content from a database to your Perspective clients or other web applications. Without needing the WebDev module. All you need is a Named Query that has appropriate security settings and returns a single row with two columns: Content, and ContentType.

Content must be a blob, binary, or bytea column (per your DB brand's types) that is represented in JDBC by an ordinary array of bytes. This will be delivered without any extra processing of any kind.

ContentType must be a string with the proper MIME type that describes the content. image/jpeg, application/pdf or similar.

Given the above, access the content with a URL of this form:

    http://gatewayAddress:port/system/blob/projectName/path/to/NamedQuery?param1=...
  

The query string on the end must provide all of the parameters the named query defines. The named query subsystem coerces strings into numbers and other types automatically, if Ignition's TypeUtilities class understands the format. Requests missing any parameter are rejected. Extra parameters are silently ignored.

For maximum security, Named Queries that are type Update will be rejected, as will any Named Query that includes a parameter of type QueryString. Neither of these are safe for use in this application.

To minimize the chance of Denial-of-Service attacks on named queries that do not return the needed columns, any such failure will be cached, so future attempts to run that query will be short-circuited. This "blacklist" is reset for a project when the project is edited and saved.

Example

Named Query example

Images stored in the blob column of the images table would be retrieved with an image source URL like this:

    http://porthos81y.example.com/system/blob/BlobServeTest/SimpleBlob?id=25