How to use Dropbox API v2 to rename a file

走远了吗. 提交于 2019-12-10 22:33:40

问题


I'd like to rename a file on Dropbox using the HTTP API.

According to the new docs, it is possible to move, but not to rename?

https://www.dropbox.com/developers/documentation/http/documentation#files-move

I'd also like to be able to modify other metadata, especially client_modified, without having to re-upload the file.

Is the documentation current, or are there additional features available?


回答1:


Ah, great, I found out that the move API can be used to rename as well.

Great!

Still unable to modify client_modified for existing files though.




回答2:


Dropbox uses Move API to Rename File/Folder, you can find accurate function/API call on official Dropbox Dev. Docs

HTTP: https://www.dropbox.com/developers/documentation/http/documentation#files-move

DOT-NET SDK (MoveV2Async): http://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_MoveAsync_1.htm

update the from-Path & to-Path value, with your updated values

{
    "from_path": "/Path/HelloWorld.txt",
    "to_path": "/Path/foo.txt"
}

it will rename "HelloWorld.txt" to "foo.txt", in "/Path" Directory



来源:https://stackoverflow.com/questions/34220574/how-to-use-dropbox-api-v2-to-rename-a-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!