10

I am attempting to upload files to my Sharepoint 2010 server running on IIS 7 via the sharepoint client object model. The issue I have found is the file size limit is very well...limiting. I have read quite a few posts on the subject and it seems as though I'm running into an issue that is separate from those that I have found posted previously. After some experimentation and trying different methods I have finally found that the limit I am hitting right now is due to the following config setting in my web.config:

<system.web>
 <httpRuntime maxRequestLength="2097151" />
</system.web>

Originally it was set at 51000 or so. I tried to put the 2 gig value that I have seen listed elsewhere at the theoretical maximum in for the value but when this is done the site won't load and the returned error states that the valid range for this setting is 0-2097151. I am wondering if there is somewhere else that this maximum allowed range is being set? It seems strange that it is so low, this basically limits any file upload I could provide to being only 2 megs which is smaller than the Sharepoint configurations upload limit of 50 megs.

Mark
  • 983
  • 2
  • 10
  • 20

2 Answers2

16

The maxRequestLength is measured in kilobytes, so you already set it to be 2GB (2097151 / 1024 / 1024 = 2).

Denis Ivin
  • 5,594
  • 1
  • 26
  • 25
  • Ok interesting, I must be hitting another cap somewhere else now. Raising this cap took me from erroring at around 100k to now somewhere above one meg. I'll just have to keep digging thanks. – Mark Nov 29 '10 at 13:19
  • 1
    @Denis Ivin, I met the same problem in my web application. If I set it to even 2097152, **the site just won't run**, just as described by the op. If I want my site to run, I **have to** set it to 2097151 at most. – smwikipedia Aug 17 '11 at 03:36
  • @Mark, where did you get this "**the returned error states that the valid range for this setting is 0-2097151**"? – smwikipedia Aug 17 '11 at 03:36
  • Yes I got that, it's been a while since we've worked on this..it's been pushed back so it might be a while before we get back to it if ever (might be looking at other options by then). – Mark Aug 24 '11 at 18:55
  • @smwikipedia Interestingly, we're seeing that message on _some_ production machines. We noticed, because ... "-1" was being rejected (though both documented **and** mentioned as a valid value in the error message itself...) – sehe Sep 12 '14 at 07:35
9

I have the same problem, but I found that you have to put

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="2147483648" />
    </requestFiltering>
  </security>
</system.webServer>

too here for some IIS up http://ajaxuploader.com/large-file-upload-iis-asp-net.htm