Genie.jl
Genie.jl copied to clipboard
Add functionality to download file
Including text files that could be rendered in the browser
Like this: https://dash.plotly.com/dash-core-components/download
route response as follow:
read("file") |> String
route response as follow:
read("file") |> String
Lot of other formats besides string as shown here: https://dash.plotly.com/dash-core-components/download
Yes, it's more about integrated functionality. How to add a "download button" which takes care of the setting up the logic behind the scenes? I haven't tested but possibly something as simple as <a href="path/to/file">Download</a>
will work as Genie handles serving static files correctly.
Just a comment: I added an example for downloading ad-hoc data, e.g. selections from a table, at https://github.com/GenieFramework/StippleDemos/tree/master/BasicExamples/TableDownloadClipboard
This functionality has been added here: https://github.com/GenieFramework/Genie.jl/blob/46b9ba7abc14a3bf40d6e0a0b9c68e20b3cb5680/src/Router.jl#L1175-L1181
I should write a guide about it and close this