How would I go about adding pre-formatted word and excel documents as downloads on my app? It seems that all the methods out there right now are CSV focused and do not allow the download of more complex data types. When I have tried to added something more like:
If you are not creating it dynamically, then it shouldn’t be any difference. I couldn’t say for sure why you are having the corrupt files (a more complete example would help), but I think that using the a assets folder instead of download would do the trick. I just tried this out myself and it worked fine. I also didn’t include any download argument in the the html.A, just the href.
assets is setup as the default folder that the underlying flask instance uses for serving static files. I believe the download folder you referenced has to do with a community post that uses a flask route to create a dynamic file on the back-end.
If you are interested in how to change that folder name, or to simply learn more about that, then check out the source here:
can you give me an example code of how that download would look like with the app layout and callback? I also need to have a template excel file available to download on my app, but don’t know how to do that.