Genie.jl icon indicating copy to clipboard operation
Genie.jl copied to clipboard

Add functionality to download file

Open essenciary opened this issue 2 years ago • 6 comments

Including text files that could be rendered in the browser

essenciary avatar Mar 30 '22 19:03 essenciary

Like this: https://dash.plotly.com/dash-core-components/download

essenciary avatar Apr 28 '22 06:04 essenciary

route response as follow:

    read("file") |> String

deahhh avatar Jun 10 '22 02:06 deahhh

route response as follow:

    read("file") |> String

Lot of other formats besides string as shown here: https://dash.plotly.com/dash-core-components/download

AbhimanyuAryan avatar Jun 14 '22 04:06 AbhimanyuAryan

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.

essenciary avatar Jun 14 '22 06:06 essenciary

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

hhaensel avatar Jul 25 '22 21:07 hhaensel

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

AbhimanyuAryan avatar Dec 08 '22 11:12 AbhimanyuAryan