Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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 file you want to upload. Below is the reference link of API and its parameters:
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
I am able to set all the other properties and API is able to create a blank file at the specified path for 'Dropbox-API-Arg', however unable to pass the file from my machine to the API call.
How can I set data-binary with the path of the file to upload, specifically in XMLHTTPRequest?
Thanks in advance.
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.
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!!!
Hi there!
If you need more help you can view your support options (expected response time for a 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!