Skip to content
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

Closed
fabiangehring opened this issue Jan 27, 2017 · 8 comments
Closed

"Lost" fileextension in downloadHandler #1562

fabiangehring opened this issue Jan 27, 2017 · 8 comments

Comments

@fabiangehring
Copy link

@fabiangehring fabiangehring commented Jan 27, 2017

The example download-knitr-reports. does not show a file extension nor a content type in the filechooser anymore.

image

shiny 1.0.0, R 3.3.1, RStudio 1.0.136 on Win 10

@jcheng5
Copy link
Member

@jcheng5 jcheng5 commented Jan 27, 2017

Thanks. What browser?

@fabiangehring
Copy link
Author

@fabiangehring fabiangehring commented Jan 27, 2017

Rstudio's intregrated browser. Other browsers seem to be fine (Chrome 56.0.2924.76, and IE Edge 25.10586.672.0)

@VincentLous
Copy link

@VincentLous VincentLous commented Feb 15, 2017

I have the same issue on Chrome/Windows.

@wch
Copy link
Collaborator

@wch wch commented Sep 27, 2017

I just tested with RStudio 1.1.299 on Windows and it also loses the extension. On Mac, it keeps the extension.

@alandipert
Copy link
Contributor

@alandipert alandipert commented Sep 27, 2017

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)

@skhan8
Copy link

@skhan8 skhan8 commented May 10, 2018

This is still happening on Windows 10 and CentOS.

@yaakovfeldman
Copy link

@yaakovfeldman yaakovfeldman commented Sep 2, 2018

Still happening with Electron on Windows 10. A working hack is to name the download button something like 'report.docx'.

@alandipert
Copy link
Contributor

@alandipert alandipert commented May 2, 2019

Closing because this is an RStudio issue: rstudio/rstudio#3483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants