cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

download file API JS

download file API JS

erik-121
Explorer | Level 3

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:

sJ0QI

Anyone could help me please?
Thanks

 

3 Replies 3

Greg-DB
Dropbox Staff

erik-121
Explorer | 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-DB
Dropbox Staff

@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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    erik-121 Explorer | Level 3
What do Dropbox user levels mean?