So I have integrated dropbox into my react app and my app successfully opens a dropbox dialog box, signs in users and list their files and folders. I am facing issues with the downloading of the selected files as blobs. Here is my code which handles the listing of files.
case 'DROPBOX':
const successCb = async (
files: ReadonlyArray<Dropbox.ChooserFile>
) => {
console.log(files);
const blobs = files.map((f) => {
return axios.get(
f.link + '?dl=1',
{
responseType: 'blob',
headers: {
Authorization: `Bearer MY_TOKEN`,
},
}
);
});
console.log(await Promise.allSettled(blobs));
};
createDropboxChooser(
{ successCb },
{
multiselect: true,
folderselect: true,
extensions: ['.pdf'],
}
);
break;
}
I have tried to use dl=1 query param to force download files but nope not working!