Custom MTOM binding and Max upload size

2019-07-31 02:46发布

I'm using the binding configuration below for my upload service,

<binding name="FileUploadSTSBinding">
          <security authenticationMode="UserNameOverTransport"
                    requireDerivedKeys="false"
                    keyEntropyMode="ServerEntropy"
                    requireSecurityContextCancellation="false"
                    requireSignatureConfirmation="false">
          </security>
          <mtomMessageEncoding/>
          <httpsTransport 
            transferMode="Streamed" 
            maxReceivedMessageSize="2147483647"/>
        </binding>

But with this setting, I'm not able to upload big files like more than 1mb, server response is bad request.

Any thoughts?

1条回答
Explosion°爆炸
2楼-- · 2019-07-31 03:35

You need to set the maxRequestLength attribute as well for the upload to work. It can here found in the web.config file here:

<configuration>
   <system.web>
      <httpRuntime>

Check that the IIS app pool identity has the right to write to the temp folder to be able to temporarily store the incoming data.

查看更多
登录 后发表回答