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
Gustavo L.5
9 years agoNew member | Level 1
Can't upload xlsx file to dropbox app
Hi guys, as the title says, I'm unable to upload an xlsx file, I can successfully upload other formats as xls, pdf, ppt, etc. but this gives an error in the moment I'm trying to upload it.
The ...
Greg-DB
9 years agoDropbox Staff
Yes, for these calls with the parameters in the header, you need to escape these characters. That is, when you use the “Dropbox-API-Arg” header, you need to make it “HTTP header safe”. This means using JSON-style “\uXXXX” escape codes for the character 0x7F and all non-ASCII characters.
Some, but not all, languages/libraries do this for you. For example, for JavaScript, to do this yourself you could do something like this:
var charsToEncode = /[\u007f-\uffff]/g;
function http_header_safe_json(v) {
return JSON.stringify(v).replace(charsToEncode,
function(c) {
return '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4);
}
);
}
and then:
"Dropbox-API-Arg": http_header_safe_json(arg)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 hours 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!