1. Home
  2. Rendering BLOB Fields

Rendering BLOB Fields

Overview

BLOB fields are becoming a more relevant and standard method of storing documents. Because of this, the decision was made to implement the ability to render and download files stored in a BLOB field with m-Power. This feature is available as of the December 2018 m-Power update.

Implementation

First you will need to create a Single Row Data List Retrieval over the table containing your BLOB field. In this retrieval, you’ll want to select a dimension field(s) which make the record unique. Include any other fields that are associated with the BLOB field, such as a separate field for the filename.

Once you have the Single Row Data List Retrieval compiled, we will be calling this using a Smartlink. Here is an example of a Smartlink URL you would create via m-Painter:

DICTIONARY.I00010s?slnk=1&SOMEKEY=${row.SOMEKEY}&downloadbinary=1&filefield=MYBLOBFIELD&file=${row.FILENAME}

Using the above code excerpt as an example, the following values are explained:

  • slnk=1 (required) Smartlink parameter to return the specific record found based off the dimension key(s) passed.
  • SOMEKEY=${row.SOMEKEY}(required) Replace ‘SOMEKEY’ with the fieldname of your sequence key. Repeat this for as many sequence keys in your app.
  • downloadbinary=1 (required) Triggers the necessary logic to render the BLOB.
  • filefield=MYBLOBFIELD (required) Replace ‘myblobfield’ with the fieldname of your BLOB field. Identifies the field in your application which contains the BLOB. This is useful if you have multiple BLOB fields in your table.
  • file=${row.FILENAME} (required) Replace ‘filename’ with the fieldname of the filename field. The value in this parameter will dictate what the BLOB download file will be named. This can be a dynamic field substitution or a hardcoded value.

The downloaded file type will pull from file extension in the ‘file’ URL parameter. The following common file types are automatically recognized without any additional parameters:

xls, xlsx, xml, pdf, csv, txt, jpeg, png, gif

If your document type is not listed above. You may pass the following optional parameter in the smartlink URL to identify the content type:

  • contentType=[contentType] (optional) Replace ‘[contentType]’ with the appropriate MIME type (i.e. contentType=application/json). A quick internet search for MIME content type should give you the value needed.
Updated on August 8, 2023

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT