We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

pacoq's avatar
pacoq
Explorer | Level 3
6 years ago

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

  • pacoq's avatar
    pacoq
    Explorer | Level 3
    6 years ago

     

    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-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    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").

  • pacoq's avatar
    pacoq
    Explorer | Level 3
    6 years ago

    so if i need to copy the entire folder to other folder i must go folder by folder?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    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.

  • pacoq's avatar
    pacoq
    Explorer | Level 3
    6 years ago

    yes, i want to copy one team folder  to other team folder

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    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

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 5 hours ago
410 Following

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!