SharePoint 中网络文件的 URL
我在 SharePoint 列表中有一个列,我希望将其链接到网络上的文件。文件位置是在代码中生成的,因此我需要编写 CAML 脚本来更新该列。
有人可以给我一个例子,说明数据库中存储的值是什么吗?在此示例中,文件位置为 \server\folder\file.txt。如果可能的话,我希望文本名称相同。
I have a column in a SharePoint list that I wish to make a link to a file on the network. The file location is generated in code so I need to write a CAML script to update the column.
Could someone please give me an example of what the value stored in the database would be? In this example the file location is \server\folder\file.txt. I would like the textual name to be the same if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于链接,您应该使用“超链接或图片”类型的列。此列类型可以处理链接及其描述。要为此字段设置这两个值,您可以使用以下代码。
SharePoint 会自动将链接从“\server\folder\file.txt”转换为“file://server/folder/file.txt”。但请注意,SharePoint 不会处理用户访问文件所需的权限。这只是一个链接。
For your link you should use a column of the type "Hyperlink or Picture". This column type can handle a link and a description for it. To set these both values for a this field you would use the following code.
SharePoint will automatically convert the link from "\server\folder\file.txt" to "file://server/folder/file.txt". But be aware that SharePoint won't handle the permissions a user needs to access the file. It's just a link.