如何从 Sharepoint 资产库获取文件名
How to get file name from Sharepoint Asset Library
如何从 SharePoint 2013 资产库中获取图像的文件名?
我正在尝试编写一个 JQuery/REST 片段来根据其他列值在库中搜索图像的子集并显示它们。如果是文档库,我会使用 FileLeafRef
,但我在资产库中找不到等效字段。
到目前为止,我尝试了以下方法,但都没有 returns 文件名:
https:///crm/_api/Web/Lists/GetByTitle('Publication%20List')/items?select=File/Name&expand=文件
https:///crm/_api/Web/Lists/GetByTitle('Publication%20List')/items?select=FileLeafRef
我相信 yt 仍然是 FileLeafRef
资产库。您是否有机会在您的问题中加入相关代码?
这是 FileLeafRef
的其余端点:
/_api/web/lists/getByTitle('<list title>')/items?$select=FileLeafRef
或者你总是可以使用 File Name
属性:
/_api/web/lists/getByTitle('<list title>')/items?$select=File/Name&$expand=File
您的示例中有一个 错别字 ,特别是 $
符号 缺少 $select
和$expand
个查询选项 (more details)。
以下其余端点演示了如何从资产库中检索文件名:
1) 使用 FileLeafRef
属性:
/_api/web/lists/getByTitle('<list title>')/items?$select=FileLeafRef
2) 使用 File/Name
属性:
/_api/web/lists/getbytitle('<list title>')/items?$select=File/Name&$expand=File
3) 使用 Folder/Files
属性:
/_api/web/getfolderbyserverrelativeurl('<list url>')/files?$select=Name
如何从 SharePoint 2013 资产库中获取图像的文件名?
我正在尝试编写一个 JQuery/REST 片段来根据其他列值在库中搜索图像的子集并显示它们。如果是文档库,我会使用 FileLeafRef
,但我在资产库中找不到等效字段。
到目前为止,我尝试了以下方法,但都没有 returns 文件名: https:///crm/_api/Web/Lists/GetByTitle('Publication%20List')/items?select=File/Name&expand=文件 https:///crm/_api/Web/Lists/GetByTitle('Publication%20List')/items?select=FileLeafRef
我相信 yt 仍然是 FileLeafRef
资产库。您是否有机会在您的问题中加入相关代码?
这是 FileLeafRef
的其余端点:
/_api/web/lists/getByTitle('<list title>')/items?$select=FileLeafRef
或者你总是可以使用 File Name
属性:
/_api/web/lists/getByTitle('<list title>')/items?$select=File/Name&$expand=File
您的示例中有一个 错别字 ,特别是 $
符号 缺少 $select
和$expand
个查询选项 (more details)。
以下其余端点演示了如何从资产库中检索文件名:
1) 使用 FileLeafRef
属性:
/_api/web/lists/getByTitle('<list title>')/items?$select=FileLeafRef
2) 使用 File/Name
属性:
/_api/web/lists/getbytitle('<list title>')/items?$select=File/Name&$expand=File
3) 使用 Folder/Files
属性:
/_api/web/getfolderbyserverrelativeurl('<list url>')/files?$select=Name