自定义 MTOM 绑定和最大上传大小
我正在为我的上传服务使用下面的绑定配置,
<binding name="FileUploadSTSBinding">
<security authenticationMode="UserNameOverTransport"
requireDerivedKeys="false"
keyEntropyMode="ServerEntropy"
requireSecurityContextCancellation="false"
requireSignatureConfirmation="false">
</security>
<mtomMessageEncoding/>
<httpsTransport
transferMode="Streamed"
maxReceivedMessageSize="2147483647"/>
</binding>
但是使用此设置,我无法上传超过 1mb 的大文件,服务器响应是错误的请求。
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还需要设置 maxRequestLength 属性才能使上传正常进行。它可以在此处的 web.config 文件中找到:
检查 IIS 应用程序池标识是否有权写入临时文件夹,以便能够临时存储传入数据。
You need to set the maxRequestLength attribute as well for the upload to work. It can here found in the web.config file here:
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.