Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
bradoyler
9 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...
- 9 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.
Greg-DB
Dropbox Community Moderator
9 years agoThanks! Can you share the rest of the problematic code though? Thanks in advance!
Greg-DB
Dropbox Community Moderator
9 years agoThe 'paper2json' GitHub link you shared is a 404 for me. (Perhaps it's not publicly accessible?)
In any case, can you share just the code snippet(s) needed to reproduce the 'â' issue?
When I download the data to an html file using `URL.createObjectURL(response.fileBlob)` the resulting html file shows the correct characters.
In any case, can you share just the code snippet(s) needed to reproduce the 'â' issue?
When I download the data to an html file using `URL.createObjectURL(response.fileBlob)` the resulting html file shows the correct characters.
- Greg-DB9 years ago
Dropbox Community Moderator
The repo is available now, and it looks like you're running in node and not browser JavaScript like I was testing with. I'll try your code in node. Thanks!- bradoyler9 years agoNew member | Level 2
more simple test: https://github.com/bradoyler/paper2json/blob/master/test/html.js
- bradoyler9 years agoNew 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-DB9 years ago
Dropbox Community Moderator
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.
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!