posit-dev / r-shinylive

https://posit-dev.github.io/r-shinylive/
Other
147 stars 15 forks source link

Shinylive won't allow downloading data tables as csv files #74

Closed MichaelWillox closed 3 months ago

MichaelWillox commented 3 months ago

I'm absolutely loving Shinylive, but I've hit a snag.

When I run this shinylive app on my local machine (Windows 11), it allows me to create a Gantt chart and table, which I can then download to a csv file. But when I host it on a GitHub page and click the download button, a download window opens, indicating there's no file. From the image below, it appears that .htm is being tacked on to the csv file.

I originally posted this issue in Stack Overflow here with my code and a link to my app, because I thought I had coded something wrong, but my colleague (thanks Thomas W!) pointed out that it is probably a bug, when I right-click on the download window and click Copy download link, that link takes me to the csv file in my Download folder. The csv file only appears in my Download folder when I use that link.

QR5kK

georgestagg commented 3 months ago

Hi Michael,

There is a known bug related to downloading files in Chromium-based browsers.

A workaround can be found on lines 4-9 in the example at https://shinylive.io/r/examples/#r-file-download, does adding this workaround to the top of your app help at all?

MichaelWillox commented 3 months ago

Thanks, @georgestagg. That worked perfectly!