cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

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: 
Highlighted

How do I get the content from shared HTML file?

Helpful | Level 6

Hi!

I am working with shared links files on my Dropbox App in PHP and I need a hand.

Currently, I send a request file to the API and get back a HTML file:

 

array(1) {
  [0]=>
  array(10) {
    [".tag"]=>
    string(4) "file"
    ["name"]=>
    string(2 "FiatoRetB_C_V02DesignB1.html"
    ["path_lower"]=>
    string(51) "/fiatoretb_c_v02design/fiatoretb_c_v02designb1.html"
    ["path_display"]=>
    string(51) "/FiatoRetB_C_V02Design/FiatoRetB_C_V02DesignB1.html"
    ["id"]=>
    string(25) "id:WEoRMx*****AAAAAAAAAXQ"
    ["client_modified"]=>
    string(20) "2019-03-12T08:46:42Z"
    ["server_modified"]=>
    string(20) "2019-03-12T08:46:43Z"
    ["rev"]=>
    string(10) "4755e2a02d"
    ["size"]=>
    int(26257)
    ["content_hash"]=>
    string(64) "203d964e139d8b15fdfe*****4835431e07f79fd7ac31ffb443717d5bcd6c3d7"
  }
}

What I need to do now, is actually to get the file content from this HTML file (the HTML code). I have tried different ways such as get_headers and others functions but without successs. 

 

The question is, how does Dropbox API can provide the file content itself? Or is there any other way to get that content?

Thank you in advance!!

1 Accepted Solution

Accepted Solutions
Highlighted

Re: How do I get the content from shared HTML file?

Dropboxer
Dropboxer

It looks like you're printing out the file metadata from an API call that returns information about the file. To get the file's actual content, you should instead use /2/files/download:

https://www.dropbox.com/developers/documentation/http/documentation#files-download 

View solution in original post

1 Reply 1
Highlighted

Re: How do I get the content from shared HTML file?

Dropboxer
Dropboxer

It looks like you're printing out the file metadata from an API call that returns information about the file. To get the file's actual content, you should instead use /2/files/download:

https://www.dropbox.com/developers/documentation/http/documentation#files-download 

View solution in original post

Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?