none
WCF Upload file issue RRS feed

  • Question

  • Hello,

    I want to upload file using the WCF Service, but my file is very big almost 600M, so I do not know if it is supported in WCF Service.

    Sunday, May 17, 2015 2:44 PM

Answers

  • Hi ewqprngt req,

    By default the max data size that can be transfered in WCF Service is 64kb, if you want to upload a 600M file, we need to do some other configuration to increase the size of the transfered data, for example the maxReceivedMessageSize/maxBufferSize/timeout value.

    So for your issue, please try to add the following configuration in your service and client side:

    <basicHttpBinding>
      <binding name="basicHttpBinding" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" 
    maxReceivedMessageSize="2147483647" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00" > <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483646"
    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding>
    Besides, please do not forget to apply the above binding configuration to the endpoint as following:
     <endpoint name="basicHttpBinding"
               address=""
               binding="basicHttpBinding"
               bindingConfiguration="basicHttpBinding"
               contract="***">
     </endpoint>


    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by ewqprngt req Monday, May 18, 2015 7:41 AM
    Monday, May 18, 2015 4:52 AM
    Moderator

All replies

  • Hi ewqprngt req,

    By default the max data size that can be transfered in WCF Service is 64kb, if you want to upload a 600M file, we need to do some other configuration to increase the size of the transfered data, for example the maxReceivedMessageSize/maxBufferSize/timeout value.

    So for your issue, please try to add the following configuration in your service and client side:

    <basicHttpBinding>
      <binding name="basicHttpBinding" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" 
    maxReceivedMessageSize="2147483647" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00" > <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483646"
    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding>
    Besides, please do not forget to apply the above binding configuration to the endpoint as following:
     <endpoint name="basicHttpBinding"
               address=""
               binding="basicHttpBinding"
               bindingConfiguration="basicHttpBinding"
               contract="***">
     </endpoint>


    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by ewqprngt req Monday, May 18, 2015 7:41 AM
    Monday, May 18, 2015 4:52 AM
    Moderator
  • Thank You Amy, after using your config file, it works. It saves me a lot of time.

    Monday, May 18, 2015 7:42 AM