We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
pacoq
6 years agoExplorer | Level 3
copy team folder to new team folder
Hi,
I am trying to copy a team folder to a new team folder but I am getting an error 'from_lookup/not_found/.'
Used id:.... format and path, no one works
c# api, code:
using (var dbx = new DropboxTeamClient(tokenMemberFile)) { var memListResult = await dbx.Team.MembersListAsync(); var memId = memListResult.Members.First(x => x.Profile.Email.Equals(adminEmail)) ?.Profile.TeamMemberId; var folders = await dbx.AsAdmin(memId).Files.ListFolderAsync(""); foreach (var entry in folders.Entries) { if (entry.Name.Equals(templateName) && entry.IsFolder) { template = entry.AsFolder; break; } } var copyRet = await dbx.AsAdmin(memId).Files .CopyV2Async(template.Id, "/new",true); <-- error
7 Replies
- Greg-DB6 years ago
Dropbox Community Moderator
In order to process a copy in the member's folder like this, you should use AsMember instead of AsAdmin.
(For reference, this is because the /2/files/copy_v2 endpoint uses the "Team Admin" mode for "Dropbox-API-Select-Admin", meaning it can't access the member's private files.)
- pacoq6 years agoExplorer | Level 3
hello, with member works but I get this error 'to/conflict/folder/...
how can I indicate that I want to copy inside the folder ?
thanks
- Greg-DB6 years ago
Dropbox Community Moderator
A 'to/conflict/folder' error indicates that the call failed because there's already a folder at the specified destination path.
If you're trying to a copy a folder to the inside of another folder, your destination path needs to include the desired name of the folder copy itself, in addition to any parent components, and not refer to a path that already exists.
For example, if you have a folder named "folder", and want to make a copy of it inside another pre-existing folder called "parent", your destination path should be "/parent/folder" (not just "/parent").
- pacoq6 years agoExplorer | Level 3
so if i need to copy the entire folder to other folder i must go folder by folder?
- Greg-DB6 years ago
Dropbox Community Moderator
I'm not sure I understand your question. Are you referring to the folder's contents? If you copy a folder, it will copy the entirety of the folder's contents, including any subfolders.
- pacoq6 years agoExplorer | Level 3
yes, i want to copy one team folder to other team folder
- Greg-DB6 years ago
Dropbox Community Moderator
When copying a folder, if it has subfolders inside it, you do not need to iterate over the subfolders. Copying a folder will copy the entire folder, including any contents, such as sub folders.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 5 hours ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!