我在Ubuntu 16.04.2中安装了闪亮的服务器,我用它作为我的电脑。当我在地址行输入主机名时,我可以连接到服务器并从网络连接的任何计算机上查看我的应用程序。问题是;当尝试上传超过5MB的数据文件(CSV)时,它接受该文件并上传它。但是在1或2秒后(我猜它在server.R中启动读取功能时)它与服务器断开连接。
这是允许上传文件超过5MB的代码。我将此代码写入global.R文件。
if(Sys.getenv('SHINY_PORT') != "") {
options(shiny.maxRequestSize=10000*1024^2)
}
我也尝试过:
options(shiny.maxRequestSize=10000*1024^2)
这是我在server.R中的数据文件的阅读功能
Dataset <- reactive({
if (is.null(input$data1)) {
# User has not uploaded a file yet
return(data.frame())
}
inFile <- input$data1
Dataset <- as.data.frame(do.call( "read.csv", args =
list(inFile$datapath,
header = input$header,
sep = input$sep,
quote = input$quote
)))
})
谢谢