We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
Andy F.5
6 years agoExplorer | Level 3
Upload text from Javascript
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...
- Greg-DBDropbox 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.)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 months agoIf 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!