We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

erik-121's avatar
erik-121
Explorer | Level 3
7 years ago

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

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,034 PostsLatest Activity: 3 hours ago
409 Following

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!