I want to display previews of the files (images, videos, docs, xl, ppt, pdf) stored on the google drive on a webpage. Which api or library should I use?
Asked
Active
Viewed 5,260 times
6
-
Does this answer your question? [Permanent links to thumbnails in Google Drive API](https://stackoverflow.com/questions/25648388/permanent-links-to-thumbnails-in-google-drive-api) – Kos Dec 04 '21 at 11:06
2 Answers
1
with the google drive api, you can get the file's metadata via the https://www.googleapis.com/drive/v2/files/YourFileID request. Then parse the JSON response and use the thumbnailLink in the file info

David
- 302
- 2
- 12
-
This should be the correct answer. But I am not sure what exactly wanted to achieve @user1288043. Thumbnail is only first page and if contains text it is not readable. – vajanko Aug 10 '20 at 13:01
-
Man, you're a lifesaver :) This should be the correct answer. For those looking to achieve this inside Google Apps Script (DriveApp), here is the ref: https://developers.google.com/apps-script/reference/drive/file#getThumbnail() – MarketerInCoderClothes May 17 '22 at 18:37
0
You can use the Documents List API, displaying thumbnails as a preview. Or you could download/export the files and generate the preview yourself.

Ali Afshar
- 40,967
- 12
- 95
- 109
-
Ali, sorry to add an off-topic comment, but care to weigh in on [this](http://stackoverflow.com/questions/10825822/google-documents-list-api-python-documentation#comment14115347_10825822)? I think we'd prefer to avoid the [whole Facebook debacle](http://meta.stackexchange.com/a/128579/130268). – Michael Petrotta May 31 '12 at 19:57