We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
erik-121
7 years agoExplorer | Level 3
download file API JS
Hi there,
I am developing a thiny web client for Dropbox using the Javascript API. What I want to have is the basic functionality (upload, download, and delete files) from an account.
I am having trouble with the downloadFile function which I don't really understand and doesn't work as I expected. I have to say that I am learning JS, and sorry, but not found so much documentation about that. I've read the API documentation.
This is my code:
function downloadFile(){ var itemValue = obtenerItemValue(); if (itemValue == null) alert('Hay que seleccionar antes un archivo'); else{ alert('Archivo a descargar: ' + itemValue); dbx.filesDownload({path: '/' + itemValue}) .then(function(response) { }) .catch(function(err) { console.log(err); callback('Error downloading file using the Dropbox API'); }); recargarItems(); } }
And I don't know what to do, the action send a POST message and gets back a response in application/byte type, as shown here:
Anyone could help me please?
Thanks
3 Replies
- Greg-DB7 years ago
Dropbox Community Moderator
[Cross-linking for reference: https://github.com/dropbox/dropbox-sdk-js/issues/229 / https://stackoverflow.com/questions/53801974/download-file-with-dropbox-api-js ]
- erik-1217 years agoExplorer | Level 3
Greg-DB escribió:[Cross-linking for reference: https://github.com/dropbox/dropbox-sdk-js/issues/229 / https://stackoverflow.com/questions/53801974/download-file-with-dropbox-api-js ]
I don't find helpful your answer... :( - Greg-DB7 years ago
Dropbox Community Moderator
erik-121 My comment here was only to link to your other posts, where someone has already answered your question, in case anyone else came across this thread with the same question.
Please refer to your other posts for more information, including a link to a sample that shows how to use a download-style method like this.
If something still isn't working as expected, please reply with more information showing exactly what the issue is.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,034 PostsLatest Activity: 3 hours ago
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 or Facebook.
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!