Comments (3)
Thanks for the report! I just tried reproducing this with that version of node and dropbox
but it worked for me:
% cat test_1065.js
const packageDetails = require('./package.json');
console.log('node version: ', process.version);
console.log('dependencies: ', packageDetails.dependencies);
const Dropbox = require('dropbox').Dropbox;
const dbx = new Dropbox({accessToken: '<ACCESS_TOKEN_REDACTED>'})
var imgPath = "/test.jpg";
dbx.filesDownload({ path: imgPath })
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.error(error);
});
% node test_1065.js
node version: v18.12.1
dependencies: { dropbox: '^10.34.0' }
DropboxResponse {
status: 200,
headers: Headers {
[Symbol(map)]: [Object: null prototype] {
'accept-ranges': [Array],
'cache-control': [Array],
'dropbox-api-result': [Array],
etag: [Array],
'original-content-length': [Array],
'x-server-response-time': [Array],
'content-type': [Array],
'accept-encoding': [Array],
date: [Array],
server: [Array],
'strict-transport-security': [Array],
'x-robots-tag': [Array],
'content-length': [Array],
'x-dropbox-response-origin': [Array],
'x-dropbox-request-id': [Array],
connection: [Array]
}
},
result: {
name: 'test.jpg',
path_lower: '/test.jpg',
path_display: '/test.jpg',
id: 'id:25N5ksooX-sAAAAAAAMlGA',
client_modified: '2021-06-04T15:47:12Z',
server_modified: '2021-06-04T15:47:13Z',
rev: '5c3f29afd81e4021eccc7',
size: 7570,
media_info: { '.tag': 'metadata', metadata: [Object] },
is_downloadable: true,
content_hash: '03ee18416f5171e7ff7dff9a9355efa3db3cfa4afe36a995720ec54f68b20f95',
fileBinary: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff e1 09 ad 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e 63 6f 6d 2f 78 61 70 2f 31 2e ... 7520 more bytes>
}
}
Can you share more specific steps/code for reproducing this? Thanks in advance!
from dropbox-sdk-js.
Thanks your code works well.
To clarify, I was using
const dbx = new Dropbox({
fetch,
clientId: process.env.DROPBOX_CLIENT_ID,
clientSecret: process.env.DROPBOX_CLIENT_SECRET,
})
dbx.auth.setRefreshToken(process.env.DROPBOX_REFRESH_TOKEN)
following example from here
Instead of the method from your example:
const dbx = new Dropbox({accessToken: '<ACCESS_TOKEN_REDACTED>'})
from dropbox-sdk-js.
I'm not sure why the method from the dropbox forum didn't work in newer node versions v18/ v20
But as i browsed the official docs, the recommended usage is of what @greg-db shared.
I shall close this.
from dropbox-sdk-js.
Related Issues (20)
- Autorename not working HOT 1
- Can I use this API without npm? HOT 1
- No error when connection dropped, causing uploads to hang forever. HOT 2
- Confusion with refresh/access tokens HOT 7
- missing extension (for esm) HOT 3
- Example does not work HOT 2
- web version of the sdk should use the browser crypto api HOT 1
- DropboxAuth.getAuthenticationUrl returns incorrect type HOT 1
- Fix TS links in the readme HOT 1
- Incorrect typescript definitions HOT 1
- Get Upload progress HOT 1
- built-in `fetch` in node 20 issues error HOT 6
- nextjs upload file Dropbox API HOT 3
- this.fetch is not a function error received HOT 3
- V10.34.0 _utils.isBrowserEnv not working in all cases. HOT 1
- res.buffer is not a function in bun HOT 2
- fileBinary not present in TS definitions for filesDownload HOT 1
- Change deprecated .buffer() to .arrayBuffer() HOT 3
- Typescript Types Missing HOT 1
- Typescript types missing "team_member_root" from NamespaceType definition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropbox-sdk-js.