R Shiny server on Ubuntu disconnects from server after uploading a file larger than the maximum upload size (5MB)

I have installed a shiny server in Ubuntu 16.04.2 which I use as my computer. I can connect to the server and see my application from any computer connected to the network when I enter the hostname in the address bar. Problem in; when trying to download a data file (CSV) that is more than 5 MB in size, it takes the file and downloads it. But after 1 or 2 seconds (I think when it starts reading a function on the .R server), it disconnects from the server.

This is the code that allows you to upload a file over 5MB. I wrote this code to the global.R file.

 if(Sys.getenv('SHINY_PORT') != "") {
 options(shiny.maxRequestSize=10000*1024^2)
 }

      

I've also tried:

options(shiny.maxRequestSize=10000*1024^2)

      

And here's my read function for the data file on the 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
  )))

  })

      

thank

+3


source to share





All Articles