It's possible to create a download button or gith-click menu option in Pulse that triggers a file download for the user where you can control the full generation of the download.

download buttons

To achieve this we use event handlers. Event handlers can trigger file downloads for the user. These work by the author returning a particular table structure from any action. This enables you to provide PDF downloads, custom text downloads or any form of download where you can fully control the content.

Steps:

  1. Add a Form.
  2. Add a button to the form.
  3. Add an event handler to the button.
  4. Return a particular format table (with a data column) from the event query.

Table Format

Column Type Description
data (Required) Text string, kdb byte array or "base64," encoded string. The content of what will be downloaded.
name (Optional) string File name that user will see downloaded.
mimeType string The MIME type of the file. Pulse will automatically detect pdf/txt/jpg/png if the filename is specified.
Download PDF Button Config

Example kdb+ Queries

Download Text

Download PDF

Custom Download Menu

Steps:

  1. Add a Table.
  2. In the editor panel, expand the interactive panel.
  3. Add an event handler to the table.
  4. Return a particular format table (with a data column) from the event query.
  5. Right-click on the table to confirm it works.
Download CSV Menu