Showing results for 
Search instead for 
Did you mean: 
Update: Find information on Dropbox support during COVID-19 here
Showing results for 
Search instead for 
Did you mean: 

File Upload

priyank New member | Level 2
New member | Level 2

I am trying to upload a file using an old dropbox api, When I use the below method the file gets saved and I am able to get the saved file, but the saved file, in my case an image can not be seen or previewed. when I hit that url it returns default blank image from dropbox.


Please let me know, if any one look into my problem. Below is how I am using it.


PATH: /somefolder/somefile.extension

BODY: base 64 encoded string


Also I have some doubts about what should be send in body.


uploadFile: function(path, body, callback) {

options = {
method: "PUT",
url : ""' + api.putFiles + "/auto/" + path,

headers: {
"Content-Length": getByteLength(body),
"Authorization": "Bearer " + access_token,
"Content-Type": "text-plain",

request(options, function(err, res, body) {
callback(err, res, body);


1 Reply 1

Re: File Upload

When uploading files, you should put the raw octet stream in the request body, not a base64 encoded string of the data.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?