cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to copy file by id and specify filename

Is it possible to copy file by id and specify filename

Brian S.53
Explorer | Level 3

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 3

Greg-DB
Dropbox Staff
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
Explorer | Level 3

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
Dropbox Staff
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.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Brian S.53 Explorer | Level 3
What do Dropbox user levels mean?