This project is read-only.

Invalid signature during upload

Feb 16, 2011 at 6:06 PM

I'm working through your examples, and can't get the upload file to work.  I have the engine initialized properly, and have successfully executed the GetAccountInfo, Download, CreateDirectory, but can't upload.

I get the error:

{"error": "Invalid signature. Expected signature base string: POST&"}

Any ideas?


Feb 16, 2011 at 6:20 PM

Ok, got it to work if I replace the path parameter (string.Empty) with an actual path.

Feb 16, 2011 at 6:23 PM



In case you are using latest version of sources - not release one, emtpy string on upload - means upload to root folder

Feb 16, 2011 at 9:08 PM

Thanks -- that fixed it!


Feb 22, 2011 at 11:36 PM

Same problem.  Able to login OK, but get "Unauthorized" exception when I try to upload.  Tried with string.Empty and "/Public" as first parameter to UploadFile.

A question on the statement:  engine.SetToken("usertoken", "usersecret");

What should the '"usertoken" and "usersecret" values be?  I have tried to set them to the same values as ApiKey and ApiSecret, but this did not work either.



Feb 22, 2011 at 11:55 PM
Edited Feb 22, 2011 at 11:59 PM

Whenever you log in, the callback method will receive a new UserInfo object.  There is a .Secret and .Token value that you need to save.  These are the values that allow you to use your dropbox without having to login again (and not have to save the user's password).

 To upload, try the following example:

DropBoxyEngine engine = new DropBoxy.DropBoxyEngine();
engine.ApiKey = apiKey; 
engine.ApiSecret = apiSecret;
engine.SetToken(token, secret); -- here are the values saved after login

Action<bool> callback = UploadCompleted;
engine.UploadFile(path, uploadFileName, buffer, callback);


Feb 23, 2011 at 6:40 AM

Thanks a lot Chuck,

Yes, thats the ticket.  Managed to upload a file successfully, but was so disappointed when I looked at the content to see that it was not what I sent up.  Only three bytes of content - Hex 20, 03, 02. 

Now where did I see that pattern before?  Oh yes, that wierd byte array in the UploadFile function call is my file content, and parameter two is just the file name and not the content.

Anyway, when I packaged up a byte array of my file content, and used it as parameter three in the UploadFile call, I ended up with my file properly uploaded to DropBox. 

Thanks again.


Feb 23, 2011 at 8:08 AM

That's funny!  I went through the same pain...