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

parseSavePath crashes if shinySaveButton does not have filetype #45

Closed
zeehio opened this Issue Sep 23, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@zeehio
Copy link
Contributor

zeehio commented Sep 23, 2016

Hi,

Thanks for your work on this package and congratulations on your PhD (I assume you have finished it since there is a new version of shinyFiles around).

Going to the issue...:

If shinySaveButton does not have filetype specified, it is set to null by formatFiletype. Then parseSavePath will crash at the data.frame(name = selection$name, type = selection$type, datapath = savefile) because the type column will be NULL..

I am not familiar enough with shiny to provide a solution (maybe replacing the type if it is NULL by something else?). I hope the issue is clear enough and hopefully you will be able to fix this.

Thanks again!

@zeehio

This comment has been minimized.

Copy link
Contributor Author

zeehio commented Sep 23, 2016

Also it may make sense to use stringsAsFactors = FALSE in the data frame that is returned from parseSavePath.

@PeterVermont

This comment has been minimized.

Copy link

PeterVermont commented Apr 8, 2017

A workaround is to pass an empty list as the filetype:

shinySaveButton('save', 'Save file', 'Save file as...', list('hidden_mime_type'=c(""))),

@thomasp85 thomasp85 closed this in 5cbf08f Apr 29, 2017

thomasp85 added a commit that referenced this issue Apr 29, 2017

Fix crash on `parseSavePath` when UI does not have filetype (#47)
* Update travis to sudo:false

* Fix crash on `parseSavePath` when the UI does not provide a `filetype`. Closes #45.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment