Iām looking for a way to create a download button in my app that allows a user to download an excel template. Then they will populate information into the template and upload the populated file to my app. This is needed because the app needs potentially hundreds of inputs and would take too long to input via the web interface (app is for processing bridge defect information).
In the help documentation, the download button seems to be focussed on downloading the result of a python script. I want to provide a file from my computer that can be stored on Viktor and downloaded as a blank template at the start of the app workflow.
Hi Sean, welcome to the community forum 
The download button indeed returns the result of a python function, but the good news is that this python function can also return the file if you store it next to your code:
# inside the parametrization
download_button = vkt.DownloadButton('Download template', method='download_template')
# inside the controller
def download_template(self, params, **kwargs):
from pathlib import Path
template_path = Path(__file__).parent / 'my_template.xlsx'
with open(template_path, 'rb') as f:
template_content = f.read()
return vkt.DownloadResult(template_content, "template.xlsx")
More information about this can be found here:
Hope this helps 