Download(file, template) Last updated: 08. Mar 2023

API only function

Producses a file using the specified template (HTML, PDF etc) and initiates the file download in the browser.


Name Type Description
file string Absolute path to file.
template string Name of the template to use to generate this file's download.


Starts a file download immidiatelly in the API call and aborts further execution of code in the script.


Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
// Generate a PDF download for a specific Docly document"somefile", "Template name.html.pdf");