cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Find out how Tiffany, a Customer Experience superstar uses Dropbox to keep her family in the loop when it comes to her new baby here!

Discuss Dropbox Developer & API

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

Chooser - downoload files

Chooser - downoload files

Wojtar
New member | Level 2

Hi,

I use `chooser` to get files from user account,  it works correctly, it gets a response:

example:

 

bytes: 172151
icon: "https://www.dropbox.com/static/images/icons64/page_white_picture.png"
id: "id:E9TA-x7u4mAAAAAAAAAAGQ"
isDir: false
link: "https://www.dropbox.com/s/p0z8hvm8emf5n0i/dropblox.png?dl=0"
name: "dropblox.png"
thumbnailLink: "https://api-content.dropbox.com/r11/t/AACr4JZ

I want now download file and put him at my server, but my server expected `formData(binary)`,  Can I do something with this respons?

1 Reply 1

Re: Chooser - downoload files

Greg-DB
Dropboxer

If you're using the Chooser and want to directly download the chosen file data, you should specify the "direct" "linkType". (Based on your sample here, you're currently using "preview" instead of "direct".)

When you use the direct link type, the Chooser result will still look similar to your sample here, but the "link" field will contain a direct link to the file data. You can then pass that link to your server and have your server download the data by using an HTTPS GET request via the HTTPS client of your choice. As long as the request is successful (i.e., check the status code for a 200), the response body will be the file data, which you can use as you wish, e.g., save it to your server's filesystem, etc. Note that these direct links expire after four hours though.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?