Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Madhavi T.
9 years agoExplorer | Level 4
Dropbox API v2
I am trying out Dropbox API V2 using HTMl,JavaScript by making API calls with XMLHTTPRequest. To upload a file onto Dropbox the API requires a 'data-binary' property to be set with the path of the fi...
Madhavi T.
9 years agoExplorer | Level 4
Thanks for the useful information Greg. ☺
I tried out the way you suggested and it seems that if I write a string (any sentence) in the value of the variable 'content' and pass it to the request keeping the path as a text file, it indeed creates a text file with the contents in it. However, I would like to pass the contents of an PDF file/image file to the request. When I try to get a file thorugh HTML input and pass it to the request, it simply creates a 0 bytes file in Dropbox with no content in it, and says the file can not be previewed. I believe this is happening because PDF files contains binary data and I am unable to do a binary-string conversion using JavaScript.
Could you please let me know if this is something you can help with. Any help is greatly appreciated. Thanks in advance.
Greg-DB
Dropbox Community Moderator
9 years agoThere's another example for uploading from a file from an input tag here:
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1359/uploading-a-file-via-jquery-in-javascript#t=201702061903317042582
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1359/uploading-a-file-via-jquery-in-javascript#t=201702061903317042582
- Madhavi T.9 years agoExplorer | Level 4
Awesome...Thanks a ton Greg!!! I just tried it and it seems to be working for me... ☺
This is a great forum. I have found a good platform in case I am stuck on anything!!!
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!