如何以编程方式列出OneDrive文件? [英] How to list OneDrive files programmatically?

查看:102
本文介绍了如何以编程方式列出OneDrive文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何迭代OneDrive的所有文件夹和文件 http //sp2013/my /personal/administrator/_api/web/lists/getByTitle('Documents') 并列出所有带有url的文件名,以便在我的Web应用程序主页中使用CSOM/JS打开它们?我需要在列表顶部列出最近上传/修改的文件.我不需要确切的文件夹结构,但是我需要每个文件夹上的文件名 列在一个平面列表中.

How can I iterate all the folders and files of OneDrive http://sp2013/my/personal/administrator/_api/web/lists/getByTitle('Documents') and list all the file names with url to open them using CSOM/JS in my web app home page? I need to list the recent uploaded/modified files on top of the list. I do not need the exact Folder structure but I need the files names on each of the folders to be listed in one flat listing.

谢谢

推荐答案

Roy,

我们可以像下面这样构建REST调用:

We can build the REST call like below:

http://sp/sites/dev/_api/web/lists/getByTitle('Documents')/items?


select = FileDirRef,FileLeafRef
select=FileDirRef,FileLeafRef

FileDirRef将为我们提供文件的url,而FileLeafRef将为我们提供文件名.

FileDirRef will give us the url of file and FileLeafRef will give us the file name.

谢谢

最好的问候


这篇关于如何以编程方式列出OneDrive文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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