cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

PHP - Show thumbnail

PHP - Show thumbnail

knalpiap
Helpful | Level 5
Go to solution

Hi peepz,

I'm running a PHP project for which I read a specific Dropbox directoty using 'list_folder'. Five files (JPG), matching certain criteria are selected from all returned files. So far, so good.
Now, I want to embed these five images in a webpage. Somehow, I don't succeed in this. It's clear to me I'm overlooking something 🙂

Assumption: I create a e.g. photo.php file which uses 'get_thumbnail' to display the image. I call this photo.php file for each of the five <img> on my page.

When I use the Api Explorer,  the files are found just fine. However, I have no clue on how to implement this into a PHP file. I know the result is some sort of image content already, but I just cannot get it to work. Where do I start?

Thanks,
Knal

10 Replies 10

Inderjeetdev
Helpful | Level 5

It worked:

 

$data = base64_encode( $response );
echo '<img src="data&colon;image/jpg;base64,'.$data.'" />';
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Inderjeetdev Helpful | Level 5
  • User avatar
    Pavlitto Explorer | Level 4
  • User avatar
    lrduques Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?