SharePoint客户端对象模型"(400) Bad Request"错误

简介:

当你在使用Microsoft.SharePoint.Client.FileCollection.Add方法或Microsoft.SharePoint.Client.File.SaveBinary方法向SharePoint Library中创建或修改文件时,可能会遇到"The remote server returned an error: (400) Bad Request"的错误。要解决这个问题,你需要修改SharePoint默认的Maximum Message Size

  打开SharePoint 2010 Management Shell然后执行下面的命令:

$ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$ws.ClientRequestServiceSettings.MaxReceivedMessageSize = your_value 
$ws.Update()

  推荐将MaxReceivedMessageSize的大小设置为Int32.MaxValue - 1,也就是2147483646.

  通常情况下你可能需要强制重启你的IIS服务,可以使用下面的命令:

iisreset /noforce

   或者,你还可以使用Microsoft.SharePoint.Client.File.SaveBinaryDirect方法来上传文件,该方法不存在这种文件大小的限制。具体的使用方法可以参考我的另一篇文章“有关SharePoint Client Object应用的笔记”。


本文转自Jaxu博客园博客,原文链接:http://www.cnblogs.com/jaxu/archive/2011/11/29/2267774.html,如需转载请自行联系原作者


相关文章
|
JSON 前端开发 小程序
uniapp:request 请求出现400错误
uniapp:request 请求出现400错误
689 0
uniapp:request 请求出现400错误
|
XML JSON 前端开发
SpringMVC运行项目出现The request sent by the client was syntactically incorrect.问题解决思路?
使用SpringMVC报HTTP Status 400 - The request sent by the client was syntactically incorrect.的错误怎么解决,你不妨看一下我的这个解决思路,再决定,往往你最忽略的地方就是你最容易报错的地方,所以我建议你看一看我的这个思路是否与你的问题一样
|
6月前
|
Python
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
|
7月前
|
JSON 数据格式
Navicate数据报错之Bad Request,发送端口测试的时候,使用JSON字符串,而不是Text
Navicate数据报错之Bad Request,发送端口测试的时候,使用JSON字符串,而不是Text
|
JSON Java 数据格式
Postman发送json数据出现HttpMessageNotReadableException: Required request body is missing的几种解决方法以及页面显示400解决
Postman发送json数据出现HttpMessageNotReadableException: Required request body is missing的几种解决方法以及页面显示400解决
636 0
|
Web App开发 前端开发 JavaScript
DevTools 无法加载 SourceMap 错误:状态代码 404,net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools 无法加载 SourceMap 错误:状态代码 404,net::ERR_HTTP_RESPONSE_CODE_FAILURE
472 0
|
网络安全 开发工具 图形学
使用SourceTree管理Unity工程推送报错 “ RPC failed; curl 55 Send failure: Connection was aborted“
使用SourceTree管理Unity工程推送报错 “ RPC failed; curl 55 Send failure: Connection was aborted“
1214 0
使用SourceTree管理Unity工程推送报错 “ RPC failed; curl 55 Send failure: Connection was aborted“