使用 Dropbox Core 在 C# 中上传文件时自动创建文件夹 API

Create folder automatically during file uploading in C# using Dropbox Core API

假设我有一个 Dropbox 帐户,我想在路径“/Client1/2016/filename.txt”中上传一个文件。我的保管箱帐户中没有文件夹 "Client1" 或“2016”。我的要求是文件上传时会自动创建导航路径文件夹"Client1/2016/"并上传file.Is可以吗? 我正在使用以下代码进行文件上传-

RequestResult strReq = OAuthUtility.Put(
                                    "https://api-content.dropbox.com/1/files_put/auto/",
                                    new HttpParameterCollection
                                        {
                                            {"access_token", "AccessToken"},
                                            {"path", "filepath"},
                                            {"overwrite", "false"}, 
                                            {"autorename","false"}, 
                                            {stream}
                                        }
                                    );

您要的是 API 已经工作的方式。如果您将文件上传到路径 /foo/bar,将根据需要创建文件夹 /foo