gpt4 book ai didi

javascript - SharePoint 2013 库检索所有文件名。休息API

转载 作者:数据小太阳 更新时间:2023-10-29 04:56:27 24 4
gpt4 key购买 nike

我在 Sharepoint 2013 上有一个库,并使用以下代码检索所有参数(在客户端使用 angularjs。)。

var spListURL = siteURL + "_api/lists/getByTitle%28%27" + docLibName + "%27%29/items";
$http.get(spListURL,
{ headers: {"Accept": "application/json; odata=verbose", } }).success(function (result) {
dfd.resolve(result);
})
.error(function (data, status, headers, config) {
errorFactory.buildError(data, status, headers, ORIGIN_VIEW_NAME);
});

但是结果不包含文件名或文件 url。我需要创建指向该文件的 anchor 链接。它确实包含我添加到列表/库中的自定义参数。

我以前从未使用过 SharePoint。客户端代码是 angularjs 工厂的一个片段,它正在运行(就 js 而言)。

不想使用 d.result[index].File.__deffered.uri 再次调用 rest,然后在新的空白窗口中打开文档。

感谢您的帮助。

最佳答案

试试

FileLeafRef

在你的网址中

site/_api/web/lists/getByTitle('LibraryName')/items?$top=1000&$select=FileLeafRef

关于javascript - SharePoint 2013 库检索所有文件名。休息API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21012362/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com