rdrop2 icon indicating copy to clipboard operation
rdrop2 copied to clipboard

oauth_listener() needs an interactive environment

Open detomas83 opened this issue 7 years ago • 2 comments

I built a Shiny application with an action button which downloads pdfs hosted in a Dropbox folder. It uses:

drop_media(): to generate the link to download the specific pdf file
browseURL(): to access the generated link

It works perfectly on my computer. However, when I publish it, the download function does not work and I get the following message: Disconnected from the server. Reload.

Looking at the log file, it throws the following error: Warning: Error in : oauth_listener() needs an interactive environment.

I´m a beginner on this type of applications. The Dropbox token is placed on the main directory, and published with the rest of the files.

The application connects successfully to the Dropbox folder in other parts of the code(global.r, server.r), but where it gets stucked is in this one:

fndownload=eventReactive(input$downloadpdf,{
    urr=drop_media("example.pdf", dtoken=token)
    urr$url
})

observeEvent(input$downloadpdf, {
    browseURL(fndownload())
})

Originnaly, the fndownload function was within the obserEvent but I got the same error as well.

There is not much information regarding remote storage Dropbox Shiny applications, but quite few threads regarding the same issue with other remote storage platforms (e.g. gsheets).

Any help will be awesome. Regards

detomas83 avatar Jun 05 '17 13:06 detomas83

I haven't tried something quite like this myself, but I notice this in the docs for drop_media:

This URL should not be used to display content directly in the browser

I don't know enough about the Dropbox API to know why that is. Would be happy to help more if you could provide a reproducible example.

ClaytonJY avatar Jun 15 '17 00:06 ClaytonJY

Thanks @detomas83 and @ClaytonJY. I'll add this to my list of bugs to check as I'm upgrading to the new API.

karthik avatar Jun 15 '17 00:06 karthik