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
yvancoyaud
8 years agoHelpful | Level 6
Merci de votre réponse,
mais qu'appelez vous une bibliothèque de nœuds ?? par rapport a une biliothèque javascript ?
Greg-DB
Dropbox Community Moderator
8 years agoL'importation de Node dont je parle est la `require ('dropbox')` dans votre code, et l'importation JavaScript à laquelle je fais référence est le `<script src=... `dans votre code.
---
The Node import I'm referring to is the `require('dropbox')` in your code, and the JavaScript import I'm referring to is the `<script src=...` in your code.
- yvancoyaud8 years agoHelpful | Level 6
Bonjour, suite,
Si j'enlève le
<script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>
du head, ça ne change rien !!! un peu comme si ligne était inutile ...
Si j'enlève le
var Dropbox = require('dropbox').Dropbox;
bien sûr j'ai une autre erreur qui me dit 'Dropbox is not a constructor' ce qui me semble normal.
Je suis un peu perdu et rien de bien clair les forums meme sur Stack Overflow.
Vos lumières m'aideraient vraiment.
Merci
YC
- Greg-DB8 years ago
Dropbox Community Moderator
Lorsque 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`.
- yvancoyaud8 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
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!