Sharepoint 2010:当名称包含+时,文件变得不可访问

编程入门 行业动态 更新时间:2024-10-25 19:34:39
本文介绍了Sharepoint 2010:当名称包含+时,文件变得不可访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用CSOM来管理我们的sharepoint 2010服务器上的文件。今天我注意到,当文件名包含+字符时,CSOM无法使用其serverRelativeURL引用该文件。还有其他人对相同或类似的问题进行了解释吗?

以下代码适用于所有不包含+字符的文件。

我尝试过各种编码serverRelativeURL但没有任何效果。

====

ClientContext = New ClientContext(m_sitePath) f = ClientContext.Web.GetFileByServerRelativeUrl(serverRelativeURL) ClientContext.Load(f) f.CheckOut() ClientContext.ExecuteQuery()

----

谢谢Ioannis

解决方案

您好Ioannis,

该属性不得包含以下非法字符:[!# &安培;'+:其中;> \\ {|}〜] |(//)|(\.\。)|(/ _)|(? / wpresources

)|(/ wpresources /).

参考:

docs.microsoft/en-us/previous-versions/office/developer/sharepoint-2010/ee540274(v%3Doffice.14)

祝你好运,

Grace Wang

Hi,

I am using CSOM to manage files on our sharepoint 2010 server. Today I noticed that when the filename contains the + character, the file cannot be referenced using its serverRelativeURL by CSOM. Has anyone else explerienced the same or similar issue?

The following code works fine for all files that do not contain the + character.

I tried all sorts of the encoding the serverRelativeURL but nothing worked.

====

ClientContext = New ClientContext(m_sitePath) f = ClientContext.Web.GetFileByServerRelativeUrl(serverRelativeURL) ClientContext.Load(f) f.CheckOut() ClientContext.ExecuteQuery()

----

Thanks Ioannis

解决方案

Hi Ioannis,

The property must not contain the following illegal characters: [!#

&'+:<>?\\{|}~]|(//)|(\.\.)|(/_)|(/wpresources

)|(/wpresources/).

Reference:

docs.microsoft/en-us/previous-versions/office/developer/sharepoint-2010/ee540274(v%3Doffice.14)

Best regards,

Grace Wang

更多推荐

Sharepoint 2010:当名称包含+时,文件变得不可访问

本文发布于:2023-11-08 06:53:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568648.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:名称   文件   Sharepoint

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!