Download a file in Dropbox using asp.net mvc

后端 未结 1 830
长发绾君心
长发绾君心 2021-01-29 04:45

I\'m using asp.net mvc 4 and dropbox-api to download a file from my dropbox account. I\'ve successfully installed the api in my project and I\'m follow

1条回答
  •  广开言路
    2021-01-29 05:26

    Non-root paths for the Dropbox API should start with "/". Your code is:

        string folder = "My Folder";
        string file = "My File.rar";
    

    ...

        using (var response = await dbx.Files.DownloadAsync(folder + "/" + file))
    

    That will result in a path "My Folder/My File.rar", but it should actually be "/My Folder/My File.rar". So, instead, you probably want code like this instead:

        using (var response = await dbx.Files.DownloadAsync("/" + folder + "/" + file))
    

    0 讨论(0)
提交回复
热议问题