cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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 with VBA

Download file with VBA

Riccardo Chojwa
Explorer | Level 4

Hi

I'm a DB beginner and have to use VBA from Excel
I'm using, in between others:

Set xmlhttp = CreateObject("WinHttp.WinHttpRequest.5.1")
myURL = "https://content.dropboxapi.com/2/files/download"
xmlhttp.SetRequestHeader "Dropbox-API-Arg", argumentString
xmlhttp.send ""

and it all seems to go well and with

xmlhttp.ResponseText

I get a bunch of unreadable text which I believe is the file content
But I don't get the file

what should be the last statament to actually download it to my PC?

thank you

Riccardo

1 Accepted Solution

Accepted Solutions

Re: Download file with VBA

Greg-DB
Dropboxer

The /2/files/download endpoint is a "content-download" style endpoint, meaning that when the call is successful, the requested file data is returned in the response body. 

 

It sounds like that is what you're seeing. That is, the text you're reading out is the raw file data. What you do with that data is up to you.

 

For instance, in this case, it sounds like you want to save that file data to the local file system. Dropbox can't offer support for interacting with the local filesystem in VBA, as that's not made by Dropbox, but it looks like you may want to use FileSystemObject.

View solution in original post

2 Replies 2

Re: Download file with VBA

Greg-DB
Dropboxer

The /2/files/download endpoint is a "content-download" style endpoint, meaning that when the call is successful, the requested file data is returned in the response body. 

 

It sounds like that is what you're seeing. That is, the text you're reading out is the raw file data. What you do with that data is up to you.

 

For instance, in this case, it sounds like you want to save that file data to the local file system. Dropbox can't offer support for interacting with the local filesystem in VBA, as that's not made by Dropbox, but it looks like you may want to use FileSystemObject.

View solution in original post

Re: Download file with VBA

Riccardo Chojwa
Explorer | Level 4

Hi Greg

thanks for your prompt and clear feedback
I get what you mean and I'm going to dig into it

I have another question but I'll start a new thread
Riccardo


Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Riccardo Chojwa Explorer | Level 4
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?