Download Button
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.

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:
- Add a Form.
- Add a button to the form.
- Add an event handler to the button.
- 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. |

Example kdb+ Queries
Download Text
Download PDF
Custom Download Menu
Steps:
- Add a Table.
- In the editor panel, expand the interactive panel.
- Add an event handler to the table.
- Return a particular format table (with a data column) from the event query.
- Right-click on the table to confirm it works.
