You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

sperkari's avatar
sperkari
New member | Level 2
6 years ago

unable to upload files using javascript

Hi There!

Hope you are doing good. 

I get the following error when I try to upload the files to dropbox. I did the following to get the access token

1. Login to the Site

2. create a App

3. Generate the Access Token 

4. Use the token in the code

 

here is my code 

      xhr.setRequestHeader('Authorization''Bearer ' + dropboxToken);
      xhr.setRequestHeader('Content-Type''application/octet-stream');
      xhr.setRequestHeader('Dropbox-API-Arg'JSON.stringify({
      path: '/'+ folder  +  file.name,
      mode: 'add',
      autorename: true,
      mute: false
      }));
      
      xhr.send(file);

 

Error I get

"Error in call to API function "files/upload": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user <https://www.dropbox.com/developers/documentation/http/teams>. "

 

 

Can some one please help me out here

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 6 years ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!