cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Upload text from Javascript

Upload text from Javascript

Andy F.5
Explorer | Level 3

I have a question where I couldn't find an example.

In my Javascript app I'm creating arbitrary JSON-snippets, which are NOT saved as file(s).

How can I upload those snippets to Dropbox?

Do I need to use `filesAlphaUpload`? And if yes - is there a snippet to show how to use it?

Or do I need to create a buffer from the JSON and upload the buffer?

Any hint appreciated...

1 Reply 1

Greg-DB
Dropbox Staff

To upload a file to Dropbox using the Dropbox JavaScript SDK (regardless of whether or not you happened to save it as a file locally), you should use the filesUpload method.

There's an example of doing so here for browser JavaScript, and here for Node. Those upload from local files, but you can also upload directly from objects in memory.

(As noted here, for large files you need to use "upload sessions", but it sounds like the files you're uploading probably aren't that large.)

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?