我需要使用WCF将大型(最大100兆)binairies上传到服务器。我按照以下说明进行操作:http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/fileuploadsilverlightwcf07142009104020AM/fileuploadsilverlightwcf.aspx
它适用于任何低于50K的东西。超过我得到415错误。任何想法?
答案 0 :(得分:1)
服务器上是否有最大POST大小限制?
答案 1 :(得分:1)
您可能想尝试将maxReceivedMessageSize和maxBufferSize设置为int.MAX并提高maxItemsInObjectGraph的值。
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c85f3ed2-0b55-4375-af79-5926b6cc527c
答案 2 :(得分:0)
在绑定配置上试试这个:
<binding name="MyWindowsAuthenticationBinding" closeTimeout="05:00:00" openTimeout="05:00:00" receiveTimeout="05:00:00" sendTimeout="05:00:00" maxBufferSize="2000000000" maxBufferPoolSize="2000000000" maxReceivedMessageSize="2000000000" messageEncoding="Mtom" transferMode="Streamed">
<readerQuotas maxDepth="2000000000" maxStringContentLength="2000000000" maxArrayLength="2000000000" maxBytesPerRead="2000000000" maxNameTableCharCount="2000000000" />