Binary Example

This example will start a download in the browser that downloads a file that is stored in the Conten Type field 'BinaryData'. The filename stored in the Content Type field 'filename' will be set as its content disposition. Streaming is set to true, so the file is streamed directly from the database to the browser. Streaming improves performance when downloading large files since the file is not stored in memory. For smaller files streaming can have a negative impact because the binary data is not cached in memory and a new streams needs to be opened for every file.

Smartsite SXML CopyCode image Copy Code
<se:binary
    field="BinaryData"
    filename="{itemdata.field(filename)}"
    contentdisposition="attachment"
    streaming="true"
/>