Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying files (e.g. images) stored in Google Drive on a website

I was wondering if its possible to access/display files like images which are stored in Google Drive on a public website.

like image 416
user1355487 Avatar asked Apr 25 '12 07:04

user1355487


People also ask

Can I embed image from Google Drive?

Go to drive.google.com, right-click any image file, and choose Get Link to get a shareable link of that image. Make sure that the access is set to Anyone on the internet with this link can view. Paste that file link in the box below to generate the HTML embed code.


2 Answers

A workaround is to get the fileId with Google Drive SDK API and then using this Url:

https://drive.google.com/uc?export=view&id={fileId}

That will be a permanent link to your file in Google Drive (image or anything else).

Note: this link seems to be subject to quotas. So not ideal for public/massive sharing.

like image 115
rufo Avatar answered Oct 02 '22 16:10

rufo


Here's the simple view link:

https://drive.google.com/uc?id=FILE_ID 

e.g. https://drive.google.com/uc?id=0B9o1MNFt5ld1N3k1cm9tVnZxQjg

You can do the same for other file types, e.g. MP3, PDF, etc.

like image 43
Mori Avatar answered Oct 02 '22 17:10

Mori