You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

GustavoLeopoldo's avatar
GustavoLeopoldo
Explorer | Level 3
2 years ago

Download XLSX files from Dropbox API using NodeJS

Hi Community,

I'm having some issues to download XLSX files from Dropbox API using NodeJs. The response is ok (200), but I need to use content-Type as binary or Txt. I would like to download the XLS file SAVE it into a local folder. Could you help me with that?

 

Thanks

Gustavo


  • GustavoLeopoldo wrote:

    ... The response is ok (200), but I need to use content-Type as binary or Txt. ...


    Hi GustavoLeopoldo,

    Since you have successfully received your data, you don't need to observe what's the actual transfer type (content-type). This same content is saved as is in your response object as binary/blob and you can do the same like you can to any other such object (i.e. to save as a file, process it, etc.). Just do it; it's not clear what's the actual issue. There is a bunch of data matching exactly to the file downloaded. It's your decision how you would interpret them (text, binary, etc.). The result contains metadata too and it might help you define actual data type.

    Hope this helps.

     

    Add: Here is a simple example how a file could be saved. Good luck.

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    GustavoLeopoldo wrote:

    ... The response is ok (200), but I need to use content-Type as binary or Txt. ...


    Hi GustavoLeopoldo,

    Since you have successfully received your data, you don't need to observe what's the actual transfer type (content-type). This same content is saved as is in your response object as binary/blob and you can do the same like you can to any other such object (i.e. to save as a file, process it, etc.). Just do it; it's not clear what's the actual issue. There is a bunch of data matching exactly to the file downloaded. It's your decision how you would interpret them (text, binary, etc.). The result contains metadata too and it might help you define actual data type.

    Hope this helps.

     

    Add: Here is a simple example how a file could be saved. Good luck.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,882 PostsLatest Activity: 3 hours ago
325 Following

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!