cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

Get thumbnails of files from shared folders

Get thumbnails of files from shared folders

nadeemphpdots
Explorer | Level 4
Hi there,

I get list of files inside shared folder using "2/files/list_folder" with "shared_link" parameter and I am using response from "2/files/list_folder"  into  "2/files/get_thumbnail_v2" api call to get thumbnails. 
"2/files/get_thumbnail_v2" api return "path/not_found/." error invalid path error.



Is there any other way to achieve this ? 
I want thumbnails of file from shared folder.

  
 
10 Replies 10

Здравко
Legendary | Level 20

@nadeemphpdots wrote:

...
Is there any api to get both thumbnail and actual image?


No, both - no. You already know how to display your thumbnail. For actual image, you can select using shared link, temporary link, or image data (like the thumbnail). Shared link can be created with 2/sharing/create_shared_link_with_settings, temporary link with 2/files/get_temporary_link, and actual image data with 2/files/download. :winking_face: First 2 give URL, the last one - data! Don't mix them again. :beaming_face_with_smiling_eyes:

The choice is yours.

 

ADD: Actually there is alternative non supported way to get links URL to contained pictures in such a shared folder link. The work of such a hacking way is not guaranteed. Executing something like:

curl https://www.dropbox.com/sh/ns2y8e6lqyh5avz/AAAHX5tPck8CHwpcSKMwV7cba?dl=0 -H "User-Agent: Mozilla" | xmllint --html --xpath "/html/body/script[last()-1]" - | tr '\n' '\f' | sed 's/.*<script type="text\/javascript".*<!\[CDATA\[.*responseReceived("\(.*\)")});.*\]\]><\/script>.*/\1/' | tr '\f' '\n' | sed 's/\\"/"/g' | sed 's/\\\\/\\/g' | jq

 ... will give you all available data for this shared link. You can filter further this information to get desired data. For example, you can get for every single photo on the shared link its thumbnail and full size picture link/URL using following:

curl https://www.dropbox.com/sh/ns2y8e6lqyh5avz/AAAHX5tPck8CHwpcSKMwV7cba?dl=0 -H "User-Agent: Mozilla" | xmllint --html --xpath "/html/body/script[last()-1]" - | tr '\n' '\f' | sed 's/.*<script type="text\/javascript".*<!\[CDATA\[.*responseReceived("\(.*\)")});.*\]\]><\/script>.*/\1/' | tr '\f' '\n' | sed 's/\\"/"/g' | sed 's/\\\\/\\/g' | jq '.entries[] | .thumbnail_url_tmpl, .preview.content.full_size_src'

I believe you can  "translate" the algorithm above to PHP. 🤫:winking_face_with_tongue:

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    nadeemphpdots Explorer | Level 4
What do Dropbox user levels mean?