Function API only Updated 17 Oct 2026
setContentDisposition(type, filename)
Tells the browser to download and save the returned result to a file with the specified name.
Parameters
typestringrequired"attachment" or "inline", attachment value downloads a file and inline displays the file in the browser.
filenamestringrequiredThe filename to use for the downloaded or displayed result. If the content disposition header is set, the output buffer will be returned to the user as a file with this name.
Returns
null. Nothing is changed unless both arguments are given.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
docly.setContentDisposition("attachment", "Excel-file.xlsx");