简体   繁体   English

DropNet文件上传永久失败

[英]DropNet File upload fails permanently

I am developing a C# application which should connect to the user`s Dropbox using the DropNet C# Api. 我正在开发一个C#应用程序,该应用程序应该使用DropNet C#Api连接到用户的Dropbox。 I connect my application like this: 我这样连接我的应用程序:

UserLogin login=client.GetToken();
client.UserLogin = login;

String url = client.BuildAuthorizeUrl();

ConnectForm authorizer = new ConnectForm(url);
authorizer.ShowDialog(this);

try
{
    UserLogin accessToken = client.GetAccessToken();

    this.toolStripStatusLabel1.Text = "connected";
}

catch (DropboxException exc)
{
    client = new DropNetClient("API KEY", "API SECRET");

    this.toolStripStatusLabel1.Text = "error";
}

My toolStripStatusLabel displays "connected" after this code part and after I try to upload a file (or to create a folder) like this 我的toolStripStatusLabel在此代码部分之后以及尝试尝试上传文件(或创建文件夹)后显示“已连接”

client.UploadFile("/", "test.txt", File.ReadAllBytes("C:/Users/Me/Desktop/test.txt"));

this.toolStripStatusLabel1.Text = "File uploaded";

it displays "File uploaded" but there are still no files in my Dropbox.. My Dropbox Api Error Log shows some 403 errors but without any further information. 它显示“已上传文件”,但我的保管箱中仍然没有文件。。我的保管箱Api错误日志显示了403个错误,但没有任何其他信息。

Does anybody know whats wrong here? 有人知道这是怎么回事吗?

I've found the solution. 我找到了解决方案。

When you register your application for "App-Folder" permission only you have to set client.useSandbox=true; 当您为“应用程序文件夹”权限注册应用程序时,只需设置client.useSandbox=true; directly after initalizing. 初始化后直接使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM