Sharepoint 2010:当名称包含+时,文件变得不可访问 [英] Sharepoint 2010: File becomes inaccessible when the name contains a +

查看:80
本文介绍了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 /).


参考:


https://docs.microsoft.com/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:

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

Best regards,

Grace Wang


这篇关于Sharepoint 2010:当名称包含+时,文件变得不可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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