Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Andy F.5
7 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...
1 Reply
- Greg-DB7 years ago
Dropbox Community Moderator
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.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!