Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9062543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:45:47+00:00 2026-06-16T15:45:47+00:00

want to save a file in database as binary data using WCF. Client is

  • 0

want to save a file in database as binary data using WCF. Client is ASP.NET C#. i have using the following code and able to send less then 100KB.

Client config file’s code is

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBinding_IService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
          textEncoding="utf-8" transferMode="StreamedResponse" useDefaultWebProxy="true"
          messageEncoding="Mtom">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
           maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_IWITSService" />

      </basicHttpBinding>
    </bindings>

    <behaviors>
      <endpointBehaviors>
        <behavior name="debuggingBehaviour">

          <dataContractSerializer maxItemsInObjectGraph="2147483647" />

        </behavior>
      </endpointBehaviors>
    </behaviors>
    <client>
      <endpoint address="http://localhost:4175/WITSWCFService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWITSService"
        contract="MyService.IWITSService" name="BasicHttpBinding_IWITSService" />
    </client>
  </system.serviceModel>

AND Service Config file’s code is given below

<system.web>
    <compilation debug="true" />
    <httpRuntime executionTimeout="4800" maxRequestLength="2147483647" />


  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpEndpointBinding" closeTimeout="01:01:00"
          openTimeout="01:01:00" receiveTimeout="01:10:00" sendTimeout="01:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Mtom" textEncoding="utf-8" transferMode="StreamedRequest"
          useDefaultWebProxy="true">
          <readerQuotas  maxDepth="64"  maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096"  maxNameTableCharCount="16384"/>
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default"  />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="WITSService.WITSService"  >

        <endpoint bindingConfiguration="basicHttpEndpointBinding" address="basic" binding="basicHttpBinding" contract="WITSService.WITSService" />


      </service>
    </services>


    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="myEndPointBehavior">
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </endpointBehaviors>
    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

When i upload 300 kb file i got this error

The remote server returned an unexpected response: (413) Request
Entity Too Large

can any one help me where i made mistake..
Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T15:45:48+00:00Added an answer on June 16, 2026 at 3:45 pm

    I have solved this issue by using this Code in my Service.config file.

    <services>
          <service name="Service.IService">
            <clear />
            <endpoint binding="basicHttpBinding" contract="Service.IService" />
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="16348" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            </binding>
          </basicHttpBinding>
          <webHttpBinding>
            <binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
          </webHttpBinding>
        </bindings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to save data from my database into xml file. I am using
I am using asp.net mvc 1.0 and I want to return a XML file
I want to save data from a xml file to my database, and below
I have a url which I want to save into the MySQL database using
I want to save a pdf and mp3 file(s) to a SQL Server database
I want to download and save pdf file to internal storage. Here is code
I want to save my program's DataModel objects to a file, and be able
I want to save some custom data into application configuration file and I need
I want to save database file in Documents Directory instead of /Library/Private Documents folder
i want to save a lot of binary data files(pdf, images, office docs...) into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.