WCF Rest上传文件大小问题

时间:2012-07-16 12:10:00

标签: c# wcf rest

最初,我的上传限制为64KB。

我在网站和此网站上经历了多项建议,并进行了以下更改

 <bindings>
  <webHttpBinding>
    <binding name="StreamedRequestWebBinding"
             maxReceivedMessageSize="10485760"
maxBufferPoolSize="10485760" maxBufferSize="10485760" closeTimeout="00:03:00"
openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
      <readerQuotas maxDepth="32" maxStringContentLength="10485760"
maxArrayLength="10485760" maxBytesPerRead="10485760" />
      <security mode="None" />
    </binding>
  </webHttpBinding>
</bindings>

<endpoint address="" bindingConfiguration="StreamedRequestWebBinding" behaviorConfiguration="web" binding="webHttpBinding"
      contract="DatingService.IRegisterService1" />

 <system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime executionTimeout="240" maxRequestLength="10240" />
<pages validateRequest="false" />

  </system.web>

进行上述更改后,我可以上传最大4MB,但我已将最大允许大小设置为10MB。我们还没有将应用程序移植到IIS,只能从visual studio进行测试。我哪里做错了? Pl建议

1 个答案:

答案 0 :(得分:-1)

4mb是应用程序服务器的默认最大邮件大小。你可以改变这个

http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.71).aspx