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

Forum Discussion

Brian S.53's avatar
Brian S.53
Explorer | Level 3
8 years ago

Is it possible to copy file by id and specify filename

I'm using the copy_v2 endpoint and I see that you can pass in file ids instead of paths, but is it possible to update the filename at the same time?

 

Thanks!

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    If you're referring to the file specified in 'from_path', not the copy_v2 endpoint doesn't offer a way to simultaneously rename that one.

    If you're referring to the file specified in 'to_path', you can either specify a path with the destination path and name you want, or specify a file ID along with 'autorename:true' to have Dropbox automatically rename the resulting copy, since the file ID would already refer to something anyway.
  • Brian S.53's avatar
    Brian S.53
    Explorer | Level 3
    8 years ago

    I was able to solve this by setting to_path = parentFileId/fileName

     

    As a follow up, are there any plans to make the create_folder endpoint work with file ids in the same way, for instance, by setting path = parentFileId/fileName?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Thanks for following up. I'm glad to hear you found the solution you were looking for.

    I'm not aware of any plans to update create_folder to support file ID-relative paths like that, but I'll pass this along as a feature request.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,033 PostsLatest Activity: 3 hours ago
409 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!