You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
bradoyler
8 years agoNew member | Level 2
docs contain invalid chars
using JS sdk method paperDocsDownload({ doc_id, export_format: 'html' }) and certain character (m-dash, curly quotes) come thru as â. The test document is here: https://paper.dropbox.com/doc/test...
- 8 years ago
Thanks!
I was able to reproduce the issue. It looks like it is a matter of encoding it properly. You can do so like this:
new Buffer(doc.fileBinary, 'binary').toString()
I'll ask the team to look into whether or not the SDK should/can do that for you though.
bradoyler
New member | Level 2
interestingly, I dont see the malformed html when I use the http api via:
curl -X POST https://api.dropboxapi.com/2/paper/docs/download \ --header "Authorization: Bearer xxyyzzzzzz" \ --header "Dropbox-API-Arg: {\"doc_id\": \"S7sSIlM2E0g6p3OXhhts4\",\"export_format\": \"html\"}"
Greg-DB
8 years agoDropbox Staff
Thanks!
I was able to reproduce the issue. It looks like it is a matter of encoding it properly. You can do so like this:
new Buffer(doc.fileBinary, 'binary').toString()
I'll ask the team to look into whether or not the SDK should/can do that for you though.
- bradoyler8 years agoNew member | Level 2
Doh! You're right.
Proper way to do this in Node 6+ is like this:
Buffer.from(doc.fileBinary, 'binary').toString()
But yea, I can't think of a reason why an SDK user would want different behavior from the HTTP API.
Thanks!
- Greg-DB7 years agoDropbox StaffFor reference, that is no longer necessary with the latest version of the SDK, v.3.x. You can just use fileBinary directly.
- Greg-DB7 years agoDropbox StaffUnfortunately, this caused a different issue. Please upgrade to v4.0.0 and use the Buffer workaround again. Apologies for the bother.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 4 days 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!