(413) Request Entity Too Large Error

6 years ago

I am consuming Nop.Plugin.Misc.WebServices and added operation (method) to upload files to product using method ProductPictureAdd.

Everything works well for file size less than 45KB but if upload more than 45 KB which is obvious for product picture it throws above error. I did google and found that I need to allow WCF to handle larger size but still NO LUCK.

Ref :

Can anyone help me how could I fixed that.

1. I did modify client web.config to have maxReceivedMessageSize="2147483647" No LUCK

        <binding name="BasicHttpBinding_INopService" maxReceivedMessageSize="2147483647" maxBufferPoolSize="52428800" maxBufferSize="2147483647">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384"
            maxBytesPerRead="20000" maxNameTableCharCount="16384" ></readerQuotas>
      <endpoint address="http://localhost/Plugins/Misc.WebServices/Remote/NopService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_INopService"
        contract="PhotoSavingsService.INopService" name="BasicHttpBinding_INopService" />

2. I also change NopCommerce - root/web.config to have uploadReadAheadSize="2147483647" No LUCK

<location path="localhost" allowOverride="true">
      <asp />
      <serverRuntime uploadReadAheadSize="2147483647" />

3. I also tried to modify Step-1 Code in Plugin.Misc.WebService/Remote/web.config

Can any one please help me to get rid of this error.

Deep Patel.
6 years ago
Nop Team,

Please help !! Any one has solution ?? I am struggling to upload images via Web Service since last 3 days.

Any help is appreciated in advance.
6 years ago

I just found solution and make it working. I am using NopCommerce 3.40 and only changed one thing in plugin/remote/web.config

I need to set "2147483647" to basicHTTPBinding Node where it has maxReceivedMessageSize = 65536. Please see updated changes in web.config file for service plugin.

We don't need to change anything apart from that. I am using IIS 8.5

        <binding name="HttpBigMessage"
             maxReceivedMessageSize="2147483647" >
          <security mode="None" />

Deep Patel