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
ThaiNguyen
3 years agoExplorer | Level 4
Use javascript to create and write file csv by api
Hello,
I want to use Javascript call API to create csv file (with data) on Dropbox.
I have read the API https://content.dropboxapi.com/2/files/upload
As I understand it, is this API used to upload files from local? But that's not the direction I want.
Because I'm using a system called Adaptive, that system uses pure Javascript, I have successfully connected to Dropbox using access token.
But, there is no Localpath for me to use: API 2/files/upload
So, I want to ask is there any way to import or create or write... csv files to Dropbox using Javascript? If there is an API please show me.
I am looking forward to hearing from you.
Thank you very much.
The /2/files/upload endpoint allows an app to upload a file to Dropbox by supplying the file data in the API call request body. The example in the documentation shows how one might do so by using curl to upload the contents from a file on the local filesystem, but that is not a requirement. Exactly where/how you get the file data to upload is up to you.
For JavaScript, we recommend using the official Dropbox API v2 JavaScript SDK. That SDK has a corresponding filesUpload method. You can find an example of using it here. That example gets the file data to upload from a file input field in an HTML form, for instance, not directly from a local filesystem.
- Greg-DBDropbox Staff
The /2/files/upload endpoint allows an app to upload a file to Dropbox by supplying the file data in the API call request body. The example in the documentation shows how one might do so by using curl to upload the contents from a file on the local filesystem, but that is not a requirement. Exactly where/how you get the file data to upload is up to you.
For JavaScript, we recommend using the official Dropbox API v2 JavaScript SDK. That SDK has a corresponding filesUpload method. You can find an example of using it here. That example gets the file data to upload from a file input field in an HTML form, for instance, not directly from a local filesystem.
- ThaiNguyenExplorer | Level 4
Thank you very much,
I did it
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!