Link to home
Create AccountLog in
Avatar of Enill

asked on

WCF REST + WebClient + Large File Transfer


I have a IIS Hosted WCF REST Service where i host some big file, between 300mb-1gb. I use WCF REST model because there will client of different platform, language and such so using GET/POST seem natural to me in this condition.

For some reason, i am able to transfer file of 120mb to the server, but the client can't receive file of over 70mb.(Im still far from my 300mb minimum). Maybe its a WCF config problem, maybe its a IIS 7.5 problem, i dont know. I am still new to all the IIS stuff.


Here is my configurations:


<?xml version="1.0" encoding="utf-8" ?>
        <binding name="webHttpBindingConfig" maxReceivedMessageSize ="2147483647" maxBufferPoolSize="2147483647" >
          <readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
        <!--<binding name="webHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00">
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096"/>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      <service name="Engine" behaviorConfiguration="Default">
            <add baseAddress="http://localhost" />
        <endpoint address="" binding="webHttpBinding" contract="IEngine" bindingConfiguration="webHttpBindingConfig" />
        <behavior name="Default">
          <serviceThrottling maxConcurrentCalls="5000" maxConcurrentInstances="5000" maxConcurrentSessions="5000"></serviceThrottling>
          <serviceMetadata httpGetEnabled="true" />
    <compilation debug="true" />
    <httpRuntime maxUrlLength="2097151" maxQueryStringLength="2097151" maxRequestLength="2147483647" />


APP.CONFIG(WPF Client using WebClient for requests):

<?xml version="1.0"?>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <!--<compilation debug="true" />-->
    <!--<httpRuntime maxUrlLength="2097151" maxQueryStringLength="2097151" maxRequestLength="2147483647" />-->
    <httpRuntime maxRequestLength="2147483647" />


WebClient code for the request:

client.UploadFileCompleted += new UploadFileCompletedEventHandler(client_UploadFileCompleted);
client.UploadFileAsync(new Uri(gVarC.SERVER_ADDRESS_DEV + "Sub?"), "POST", @"C:\Video\Video.rar");

Thanks in advance!
Avatar of Najam Uddin
Najam Uddin
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account