New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to recursively download all sharepoint doc files from folders and subfolders? #98
Comments
Got a link, which says we retrieve the entire folder and file structure tree using a query. First answer of this link: https://sharepoint.stackexchange.com/questions/159105/with-rest-recursively-retrieve-file-and-folder-directory-structure I am trying to replicate this from the above link using your api: /_api/web/Lists/GetByTitle('Documents')/Items?$select=FileLeafRef,FileRef But when I try this using below code:
It fails with an error: "'str' object has no attribute 'payload'" What to do? |
Hi, you might use approach of calling proc, which recursively calls itself, e.g.: def printAllContents(ctx, relativeUrl):
m. |
... you may then, for instance, download each file using ServerRelativeUrl which gets printed out ... |
I posted my query here: in a more structured way. |
FYI: The JSON there is just for representational/understanding purpose. |
I'm not sure what you are getting at. I think the proc I've listed an example of just does that...recursively lists all folders/subfolders and files within these folders and subfolders... |
Example of downloading the files as you go down the tree recursively...
|
this way will give you the flat list contains Parent folder and Nth sub folders.. however, this is slower in term of performance. |
Greetings, since this question has been answered I propose to close it |
Error message : NameError: name 'downloadFile' is not defined |
An example of a downloadFile proc which you are missing:
|
I have a requirement where I've to recursively download all the files from root folder, subfolder and sub of subfolder to Nth.
How can I go about it? Is there a method to list folders in a particular folder? Also, how can I list folders in the root Document Library? @vgrem @Bachatero
The text was updated successfully, but these errors were encountered: