Uploading Large files to SharePoint on Windows Server 2008 and IIS7

Uploading Large files to SharePoint on Windows Server 2008 and IIS7

  • Comments 7
  • Likes

If you are trying to upload files to SharePoint and are using Windows Server 2008 with IIS 7, there's one additional step you need to make to your environment other than the typical Large File changes needed.

Basically, any file over 28mb will error out upon uploading. The dreaded "The page cannot be displayed". Ugh.  Luckily, the solution is rather simple (as long as your environment is already configured for large file support… see post: SharePoint Large File Upload Configuration). You need to add another setting to your web.config to support the maximum allowed content length (maximum size of a file that you support).

  1. To change it: navigate to the SharePoint webapplication directory, by default: inetpub\wwwroot\wss\VirtualDirectories\VirtualDirectoryFolder

  2. You need to add the following configuration to your config file:

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

    image 
    The length that you add needs to be in bytes, and needs to match the file size that you want to upload. For example, I'm using 158334976 bytes here because in Central Admin I have maximum file upload size set to 150mb.  For a utility to convert bytes, see this post.


Make sure that you set this a little larger than what you have configured in SharePoint… that way your users will still get an error message stating that they are exceeding the file size limit.

Happy uploading.

Comments
  • It's so nice to find such a simple, well-laid-out fix for a problem that I've been googling (and banging my head against the wall) for two days. Thank you so much!!

  • Yep, agree. A very informative, easy to follow solution. Very much appreciated.

  • Worked great thanks.  

    I pasted your text into the wrong web.config file in one of two virtual directory folders.  I got a 500 Internal server error.  Once I took it out and put it in the correct file, everything worked.  Some of our videos are almost a Gig., and they upload fine.  

  • I have some additional configuration stuff in that section, I think it has to do with ajax, if I put it at the end, I get a 500 error, if I put it at the beginning it runs, but I still get the 'file not found' error. if I remove it, I can't upload any files, I can't seem to get it back to working now either for small files.

    Without:

     <system.webServer>

       <handlers>

         <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

         <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

         <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

         <remove name="WebServiceHandlerFactory-Integrated" />

       </handlers>

       <modules>

         <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

       </modules>

       <validation validateIntegratedModeConfiguration="false" />

     </system.webServer>

    With and no 500 error:

     <system.webServer>

       <requestFiltering>

           <requestLimits maxAllowedContentLength="115343360"/>

       </requestFiltering>

       <handlers>

         <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

         <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

         <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

         <remove name="WebServiceHandlerFactory-Integrated" />

       </handlers>

       <modules>

         <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

       </modules>

       <validation validateIntegratedModeConfiguration="false" />

     </system.webServer>

    Any help would be appreciated.

    Thanks

  • It's really nice documents. However; still not working in my case.

    Trying to upload 1.4 GB files to sharepoint 2010 (running on 2008 R2 OS) with a separated SQL 2008 Standard.

    Any idea?

    Thanks,

    Tri

  • Do I have to restart anything after these changes ? (IIS, etc.)

    thanks

  • Shouldn't have to restart anything as a change to web.config restarts the app pool automatically.... however, that being said if it's not taking, then an IIS Reset never hurts. :)

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment