var dbx = new Dropbox({ accessToken: dbx_access_token , fetch});
await dbx.filesDownload({
path: dbx_path
}).then(async (response) => {
console.log("down");
await response.pipe(temporaryFileStream);
}).catch((error) => {
console.log(error);
});
This is the code i am using to download a file. And then I want to open it.
So, first i get this 409 error.
status: 409,
headers: HeadersList {
cookies: null,
[Symbol(headers map)]: Map(12) {
'cache-control' => [Object],
'content-security-policy' => [Object],
'x-content-type-options' => [Object],
'content-type' => [Object],
'accept-encoding' => [Object],
'date' => [Object],
'server' => [Object],
'content-length' => [Object],
'strict-transport-security' => [Object],
'x-robots-tag' => [Object],
'x-dropbox-response-origin' => [Object],
'x-dropbox-request-id' => [Object]
},
[Symbol(headers map sorted)]: null
},
error: {
error_summary: 'path/not_found/...',
error: { '.tag': 'path', path: [Object] }
}
}
1. So the path i give to dbx.filesDownload is, path: '/{App-Folder-Name}/{Folder-name}/file.ext
2. Then , i want to know if we download this file, how can I save it to the temprary file path i define (
const temporaryFilePath = path.join(__dirname, '..', 'temp', `${document.title}`);) .
.. If it is easy I would prefer if you suggest to open this in googledocs with view access only.... and again with write access along with the answer to Q2
Thanks!