zoukankan      html  css  js  c++  java
  • CSOM:服务器不允许将邮件大于 2097152 字节

    在sharepoint csom, js调用中,功能需求是将图片转换为字节,存在sharepoint list中。当提交的内容大于1M左右时,就会提示"Original error: Microsoft.SharePoint.Client.InvalidClientQueryException: 请求消息太大。服务器不允许大于 2097152 字节的消息"。
    解决方案:在应用服务器上,powshell进行配置就行。
    $ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService 
    $ws.ClientRequestServiceSettings.MaxReceivedMessageSize = 209715200 
    $ws.ClientRequestServiceSettings.MaxParseMessageSize = 209715200 
    $ws.Update()  
     1  function updateListItem(title, logo, webID, summary, themeBackground) {
     2         var clientContext = new SP.ClientContext();
     3         var oList = clientContext.get_web().get_lists().getByTitle('SiteInfo');
     4         var ID= $("#siteInfoItemID").val();
     5         this.oListItem = oList.getItemById(ID);
     6         oListItem.set_item('Title', title);
     7         oListItem.set_item('ThemeLogo', logo);
     8         oListItem.set_item('Summary', summary);
     9         oListItem.set_item('ThemeBackground', themeBackground);
    10         
    11         oListItem.update();
    12         clientContext.executeQueryAsync(
    13             Function.createDelegate(this, this.onQuerySucceeded),
    14             Function.createDelegate(this, this.onQueryFailed)
    15         );
    16     }
    View Code

     参考链接:http://www.guanggua.com/question/18861407-sharepoint-error-the-server-does-not-allow-messages-larger-than-2097152-bytes.html

    技术本身并不重要,持续学习才是最重要的
  • 相关阅读:
    andrax不为人知的秘密
    SecuritySRT console已经建立链接为什么还没有反应?
    必备软硬件
    关于mt的个人看法及优缺点
    hash是什么
    usb接口的缺点
    古董交换机欣赏
    博客圆低调的文章审核机制
    手机技术控不能买哪些手机,应该买什么手机
    两个以上vlan三台以上交换机配置好,网络不通,引发的思考
  • 原文地址:https://www.cnblogs.com/only-levis/p/8991488.html
Copyright © 2011-2022 走看看