none
Received 413(Request Entity Too Large) While Upload file to wcf RRS feed

  • Question

  • My Web service is sitting on top of ssl. I have read about the setting the upload read ahead size metabase property of IIS.

    http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx

    Not fully sure about this how to increase the size .

    Thursday, August 8, 2013 4:03 PM

Answers

  • Hi,

    When occur this problem, you may need to do the following:

    1.UploadReadAheadSize

    If the error occurred because of the size of the page, it is very large and it caused to request entry body become larger when you submitting the page. 
    Then you should increase the UploadReadAheadSize. (Default size 48kb):

    appcmd.exe set config -section:system.webserver/serverruntime /uploadreadaheadsize: 1048576 /commit:apphost


    2.maxReceivedMessageSize
    In WCF, by modifying the "maxReceivedMessageSize" in the Web.config file to accept large messages to solve this issue.

    <system.serviceModel>
      <bindings>
        <basicHttpBinding>
          <binding maxReceivedMessageSize="10485760">
            <readerQuotas ... />
          </binding>
        </basicHttpBinding>
      </bindings>  
    </system.serviceModel>
    
    Best Regards.

    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Monday, August 12, 2013 2:34 AM
    Moderator
  • Hi,

    We can not do that as there is no interface to get the current value, the default value is 48kb.
    If UploadReadAheadSize is smaller than the content length, an HTTP 413 error is returned, and the connection is closed to prevent deadlock.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Tuesday, August 13, 2013 2:07 AM
    Moderator

All replies

  • Hi,

    When occur this problem, you may need to do the following:

    1.UploadReadAheadSize

    If the error occurred because of the size of the page, it is very large and it caused to request entry body become larger when you submitting the page. 
    Then you should increase the UploadReadAheadSize. (Default size 48kb):

    appcmd.exe set config -section:system.webserver/serverruntime /uploadreadaheadsize: 1048576 /commit:apphost


    2.maxReceivedMessageSize
    In WCF, by modifying the "maxReceivedMessageSize" in the Web.config file to accept large messages to solve this issue.

    <system.serviceModel>
      <bindings>
        <basicHttpBinding>
          <binding maxReceivedMessageSize="10485760">
            <readerQuotas ... />
          </binding>
        </basicHttpBinding>
      </bindings>  
    </system.serviceModel>
    
    Best Regards.

    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Monday, August 12, 2013 2:34 AM
    Moderator
  • Is there any way to check the current size, I know it's 48 kb by default but looking to know more about this.

    Thanks

    Monday, August 12, 2013 9:00 PM
  • Hi,

    We can not do that as there is no interface to get the current value, the default value is 48kb.
    If UploadReadAheadSize is smaller than the content length, an HTTP 413 error is returned, and the connection is closed to prevent deadlock.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Tuesday, August 13, 2013 2:07 AM
    Moderator