"Maximum upload size exceeded" when upload csv data

12,777 views
Skip to first unread message

xiong xiong

unread,
Jul 17, 2013, 7:22:29 AM7/17/13
to shiny-...@googlegroups.com
Failed to upload a CSV file by fileInput(). Any ideas?

Sarven Capadisli

unread,
Jul 17, 2013, 1:52:16 PM7/17/13
to shiny-...@googlegroups.com
On 07/17/2013 01:22 PM, xiong xiong wrote:
> Failed to upload a CSV file by fileInput(). Any ideas?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Shiny - Web Framework for R" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to shiny-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Check your server's request limits. If you are using Apache, you might
want to look at LimitRequestBody and ProxyIOBufferSize.

-Sarven

Joe Cheng

unread,
Jul 17, 2013, 5:52:08 PM7/17/13
to shiny-...@googlegroups.com
  • By default, Shiny limits file uploads to 5MB per file. You can modify this limit by using the shiny.maxRequestSize option. For example, adding options(shiny.maxRequestSize=30*1024^2) to the top of server.R would increase the limit to 30MB.


On Wed, Jul 17, 2013 at 10:52 AM, Sarven Capadisli <in...@csarven.ca> wrote:
On 07/17/2013 01:22 PM, xiong xiong wrote:
Failed to upload a CSV file by fileInput(). Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send

For more options, visit https://groups.google.com/groups/opt_out.


Vincent Nijs

unread,
Aug 15, 2013, 11:48:22 PM8/15/13
to shiny-...@googlegroups.com
The max limit works great. Nice feature. Question: Is there a way to activate the limit when the app is running on a server but not when run locally? I could use interactive() but then the size-limit would also be activated if the app is run locally from a command line.


On Wednesday, July 17, 2013 2:52:08 PM UTC-7, Joe Cheng [RStudio] wrote:
  • By default, Shiny limits file uploads to 5MB per file. You can modify this limit by using the shiny.maxRequestSize option. For example, adding options(shiny.maxRequestSize=30*1024^2) to the top of server.R would increase the limit to 30MB.
On Wed, Jul 17, 2013 at 10:52 AM, Sarven Capadisli <in...@csarven.ca> wrote:
On 07/17/2013 01:22 PM, xiong xiong wrote:
Failed to upload a CSV file by fileInput(). Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send

For more options, visit https://groups.google.com/groups/opt_out.


Joe Cheng

unread,
Aug 16, 2013, 7:44:33 PM8/16/13
to shiny-...@googlegroups.com
Hmmm, you could look for both SHINY_PORT and SHINY_SERVER_VERSION environment variables (using Sys.getenv), and if either is set then it means Shiny Server is hosting you.

Vincent Nijs

unread,
Aug 19, 2013, 10:41:03 PM8/19/13
to shiny-...@googlegroups.com
Works great. Thanks Joe!

I put the following in global.R

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

That way the max limit is 10GB when the app is run locally and 5MB when run from the server.

Amber James

unread,
May 12, 2015, 8:01:14 AM5/12/15
to shiny-...@googlegroups.com
Are there any workarounds for uploading the data yet? For example, a way to call large amounts of data by streaming the csv file or breaking it up. I am attempting to plot larger data sets but, after hours of research, I really haven't found a solution. Sorry if this is already answered. 


On Wednesday, July 17, 2013 at 5:52:08 PM UTC-4, Joe Cheng [RStudio] wrote:
  • By default, Shiny limits file uploads to 5MB per file. You can modify this limit by using the shiny.maxRequestSize option. For example, adding options(shiny.maxRequestSize=30*1024^2) to the top of server.R would increase the limit to 30MB.
On Wed, Jul 17, 2013 at 10:52 AM, Sarven Capadisli <in...@csarven.ca> wrote:
On 07/17/2013 01:22 PM, xiong xiong wrote:
Failed to upload a CSV file by fileInput(). Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send

For more options, visit https://groups.google.com/groups/opt_out.


Joe Cheng

unread,
May 12, 2015, 3:57:54 PM5/12/15
to Amber James, shiny-...@googlegroups.com
Does setting options(shiny.maxRequestSize) to a large value not work?

Steven Wasik

unread,
Jul 12, 2016, 1:21:29 PM7/12/16
to Shiny - Web Framework for R
Hi Joe,


R: 3.2.3
Rstudio: Server edition Version 0.99.893
shiny: 0.13.2
OS: Linux

I am attempting to recreate the app located at http://shiny.rstudio.com/gallery/upload-file.html on my own server but I am getting the error below when I launch from Rstudio server edition(i.e. port 8787).  

Warning: Error in options: unused argument (shiny.maxRequestSize = 100 * 1024^2)
Stack trace (innermost first):
    38: options
     1: runApp
Error in options(shiny.maxRequestSize = 100 * 1024^2) : 
  unused argument (shiny.maxRequestSize = 100 * 1024^2)


Two things to note:
  • This error does not occur when I visit the app through chrome (i.e. port 3838).  
  • This error does not occur when I try locally (server.R and ui.R on my c drive), launching from the app Rstudio using Rstudio Version 0.99.1249, R 3.3.1 and shiny 0.13.2 

Thanks,

Steve



On Wednesday, July 17, 2013 at 5:52:08 PM UTC-4, Joe Cheng [RStudio] wrote:
  • By default, Shiny limits file uploads to 5MB per file. You can modify this limit by using the shiny.maxRequestSize option. For example, adding options(shiny.maxRequestSize=30*1024^2) to the top of server.R would increase the limit to 30MB.
On Wed, Jul 17, 2013 at 10:52 AM, Sarven Capadisli <in...@csarven.ca> wrote:
On 07/17/2013 01:22 PM, xiong xiong wrote:
Failed to upload a CSV file by fileInput(). Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send

For more options, visit https://groups.google.com/groups/opt_out.


Joe Cheng

unread,
Jul 12, 2016, 3:41:34 PM7/12/16
to Steven Wasik, Shiny - Web Framework for R
!?!? The base::options function takes ... parameters, so that error message shouldn't be possible. Unless maybe you're loading a package that masks the "options" function with a different one? Can you print(environment(options)) and see what it says? (I'd expect "<environment: namespace:base>")

Steven Wasik

unread,
Jul 12, 2016, 9:30:00 PM7/12/16
to Shiny - Web Framework for R, steven....@gmail.com
Thanks Joe!  I feel a bit sheepish that this issue was caused by two packages sharing a function name but I was thrown off by the fact that it ran fine through port 3838.

Gary Whiteford

unread,
Jul 23, 2019, 5:01:11 PM7/23/19
to Shiny - Web Framework for R
Is there a threshold for file uploads to a Shiny app that "should never be exceeded"? 

Image result for here be dragons


On Wednesday, July 17, 2013 at 4:52:08 PM UTC-5, Joe Cheng [RStudio] wrote:
  • By default, Shiny limits file uploads to 5MB per file. You can modify this limit by using the shiny.maxRequestSize option. For example, adding options(shiny.maxRequestSize=30*1024^2) to the top of server.R would increase the limit to 30MB.
On Wed, Jul 17, 2013 at 10:52 AM, Sarven Capadisli <in...@csarven.ca> wrote:
On 07/17/2013 01:22 PM, xiong xiong wrote:
Failed to upload a CSV file by fileInput(). Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send

For more options, visit https://groups.google.com/groups/opt_out.


Joe Cheng

unread,
Jul 23, 2019, 6:09:52 PM7/23/19
to Gary Whiteford, Shiny - Web Framework for R
Not particularly. The file is streamed to a temp file as it's uploaded, so it's really a matter of how much max disk space you want to allow one of these uploads to consume.

To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.

Gary Whiteford

unread,
Jul 23, 2019, 10:45:45 PM7/23/19
to Shiny - Web Framework for R
Good to know... Thanks for the quick response!
Reply all
Reply to author
Forward
0 new messages