setContentDisposition(type, filename) Last updated: 26. May 2025

API only function

Tells the browser to download and save the returned result to a file with the specified name.

Parameters

Name Type Description
type string "attachment" or "inline", attachment value downloads a file and inline displays the file in the browser.
filename string Sets the content disposition header and tells the browser to download and save the returned result.
If this header is set

Returns

null

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
docly.setContentDisposition("attachment", "Excel-file.xlsx");