New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Lost" fileextension in downloadHandler #1562
Comments
|
Thanks. What browser? |
|
Rstudio's intregrated browser. Other browsers seem to be fine (Chrome 56.0.2924.76, and IE Edge 25.10586.672.0) |
|
I have the same issue on Chrome/Windows. |
|
I just tested with RStudio 1.1.299 on Windows and it also loses the extension. On Mac, it keeps the extension. |
|
When run inside RStudio 1.0.153 on Windows 10, the downloaded file is called "downloadData". The built-in viewer seems to use the last path component of the link instead of the name and extension as sent by the server. library(shiny)
ui <- downloadLink('downloadData', 'Download')
server <- function(input, output) {
output$downloadData <- downloadHandler(
filename = function() {
paste('data-', Sys.Date(), '.csv', sep='')
},
content = function(con) {
write.csv(mtcars, con)
}
)
}
shinyApp(ui = ui, server = server) |
|
This is still happening on Windows 10 and CentOS. |
|
Still happening with Electron on Windows 10. A working hack is to name the download button something like 'report.docx'. |
|
Closing because this is an RStudio issue: rstudio/rstudio#3483 |
The example download-knitr-reports. does not show a file extension nor a content type in the filechooser anymore.
shiny 1.0.0, R 3.3.1, RStudio 1.0.136 on Win 10
The text was updated successfully, but these errors were encountered: