zoukankan      html  css  js  c++  java
  • 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应用的笔记”。

  • 相关阅读:
    功能规格说明书
    绝望的作业
    php闭包
    php isset emtpy
    PHP超级全局变量、魔术变量和魔术函数
    死锁的一个例子
    php session cookie
    http状态码301、302
    php浮点数
    学过的设计模式
  • 原文地址:https://www.cnblogs.com/jaxu/p/2267774.html
Copyright © 2011-2022 走看看