当我将图像插入Sql服务器时,出现错误远程服务器返回错误:(400)Bad Request. [英] When i am inserting an image into Sql server i am getting an error The remote server returned an error: (400) Bad Request.

查看:119
本文介绍了当我将图像插入Sql服务器时,出现错误远程服务器返回错误:(400)Bad Request.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WCF体系结构,将图像插入Sql服务器时出现错误远程服务器返回错误:(400)错误的Request.有时它显示错误,例如反序列化错误类型为System.Byte []的对象.读取XML数据时,已超出最大数组长度配额(16384).通过更改在创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxArrayLength属性,可以增加此配额.第1行,位置31245."

i am using WCF Architecture,When i am inserting an image into Sql server i am getting an error The remote server returned an error: (400) Bad Request.some time it shows the error like ''There was an error deserializing the object of type System.Byte[]. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 31245.''.

推荐答案

在您的web.config文件中搜索< readerQuotas

并将其更改为
In your web.config file search for the < readerQuotas

and change it to
<readerQuotas maxDepth="2147483647" 
  maxStringContentLength="2147483647"
  maxArrayLength="2147483647" 
  maxBytesPerRead="2147483647" 
  maxNameTableCharCount="2147483647" />



这样您可以上传2GB的文件大小.或者,如果您只想测试代码,请上传小于16KB(默认大小)的图片.



This will allow you to upload 2GB file size. or If you just want to test your code then upload a image which is less than 16KB (default size).


这篇关于当我将图像插入Sql服务器时,出现错误远程服务器返回错误:(400)Bad Request.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆