Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Inter80801
6 years agoExplorer | Level 3
What is the format of the file downloaded via API?
I download the file through Dropbox API at the server side of my app in the following manner: // setting variable for buffering let fileBuffered = ''; // authentication const dropbox = dropboxV2A...
Inter80801
6 years agoExplorer | Level 3
Greg, thank you for your prompt response. I fully understand that there is no issue with Dropbox API and response (let's call it fileBuffered) that I get on my server-side is accurate. Regardless is I send "Content-Type", "application/pdf" or "Content-Type", "application/octet-stream" I get a strange response on my client-side
The fileBuffered size on a server-size is 132,597. The some how it grows to 254Kb when sent to a client-side. It is clear that there is no issue with Dropbox API but maybe you know how to tacke the issue?
Server-side
const file = fileBuffered;
res.setHeader("Content-Type", "application/stream-octet");
res.send(file);
Client-side
function documentFileDownload(fileName) {
const ip = location.host;
let request = $.ajax({
type: "POST",
url: `${http() + ip}/documentFileDownload`,
headers: {
"Accept": "application/stream-octet"
},
data: {
fileName: fileName
},
error: function (err) {
console.log("ERROR: " + err);
}
});
console.log(request);
return request;
}
Greg-DB
Dropbox Community Moderator
6 years agoUnfortunately I can't provide support for that side of the operation, since it's not related to the Dropbox API.
I do notice you reversed "application/octet-stream" as "stream-octet" in your code though.
- Inter808016 years agoExplorer | Level 3
Thank you Greg,
The reversed "application/octet-stream" was typo and it wasn't an issue. I found a solution. Thank you for your help!
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!