Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Riccardo Chojwa's avatar
Riccardo Chojwa
Explorer | Level 4
5 years ago
Solved

Download file with VBA

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

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

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    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.

  • Riccardo Chojwa's avatar
    Riccardo Chojwa
    Explorer | Level 4
    5 years ago

    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


About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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, Facebook or Instagram.

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!