Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
yvancoyaud
8 years agoHelpful | Level 6
utilisation de l'API filesGetThumbnail
Bonjour,
Je suis au début de mes essais du SDK javascript de Dropbox et j'ai le problème suivant:
Le contexte :
<head>
<title>testDropbox</title>
<script src="https://unpkg.com/dropbox/di...
- 8 years ago
Mille merci, ça fonctionne.
Je remets ci-dessous le code si cela peut servir à d'autres développeurs sous Meteor.
Dabord :
$ meteor npm i dropbox -s
va inclure dans l'environnement du projet Meteor, "dropbox" et "dropbox-sdk"
<head> ..... <script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script> ..... </head>let dbx = new Dropbox.Dropbox({accessToken:'MY_APP_TOKEN'}); dbx.filesListFolder({path: ''}) .then(function(response) { console.log(response) dbx.filesGetThumbnail({"path": "/IMG90.jpeg"}) .then(function(response) { var img = document.createElement('img'); img.src=window.URL.createObjectURL(response.fileBlob); document.body.appendChild(img); }) .catch(function(error) { console.log("got error:"); console.log(error); }); }) .catch(function (error) { console.log(error); })Voila cette configuration fonctionne pour moi.
Merci encore à Greg K.
YC
Greg-DB
Dropbox Community Moderator
8 years agoLorsque vous supprimez la ligne `var Dropbox = require ('dropbox'). Dropbox;` line, vous devez changer la façon dont vous accédez au constructeur. Au lieu de `new Dropbox`, faites` new Dropbox.Dropbox`.
---
When you remove the `var Dropbox = require('dropbox').Dropbox;` line, you will need to switch how you access the constructor. Instead of `new Dropbox`, do `new Dropbox.Dropbox`.
yvancoyaud
8 years agoHelpful | Level 6
Mille merci, ça fonctionne.
Je remets ci-dessous le code si cela peut servir à d'autres développeurs sous Meteor.
Dabord :
$ meteor npm i dropbox -s
va inclure dans l'environnement du projet Meteor, "dropbox" et "dropbox-sdk"
<head>
.....
<script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>
.....
</head>
let dbx = new Dropbox.Dropbox({accessToken:'MY_APP_TOKEN'});
dbx.filesListFolder({path: ''})
.then(function(response) {
console.log(response)
dbx.filesGetThumbnail({"path": "/IMG90.jpeg"})
.then(function(response) {
var img = document.createElement('img');
img.src=window.URL.createObjectURL(response.fileBlob);
document.body.appendChild(img);
})
.catch(function(error) {
console.log("got error:");
console.log(error);
});
})
.catch(function (error) {
console.log(error);
})
Voila cette configuration fonctionne pour moi.
Merci encore à Greg K.
YC
- Greg-DB8 years ago
Dropbox Community Moderator
Le problème d'origine `t.buffer n'est pas une fonction` devrait être corrigé dans la dernière version de la bibliothèque, actuellement v4.0.3.
---
The original `t.buffer is not a function` issue should be fixed in the latest version of the library, currently v4.0.3.
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!