How To Embed An Image From Google Drive

How To Embed An Image From Google Drive
Facebook may have decided that you shouldn’t see the news, but we think you deserve to be in the know with Lifehacker Australia’s content. To sign up for our daily newsletter covering the latest news, hacks and reviews, head HERE. For a running feed of all our stories, follow us on Twitter HERE. Or you can bookmark the Lifehacker Australia homepage to visit whenever you need a fix.


You can store photos and other images on Google Drive, but Google doesn’t offer an easy option for embedding that image on another web page (as it does for videos or PDF files). Google Operating System outlines a URL hack which allows you to include pictures stored on Google Drive in other pages.

If you edit an uploaded picture, you’ll see a URL in the form

https://docs.google.com/document/d/FILEID/edit

where FILEID is a very long sequence of characters. Edit this so it reads

http://drive.google.com/uc?export=view&id=FILEID

Note that this will only work if you set the access permissions on the uploaded image to be public; a private file (which is the default) won’t work. It’s unlikely you’d permanently store images on Google Drive for use on a web site, but it could be useful in some circumstances.

Permalinks for Google Drive Images [Google Operating System]

Comments

  • You can use gdriveurl.com, it got updated and now allows users to log in with their google drive account and share the list of files instantly, getting for each file “View” & “Download” short permalink.

    There’s also the old solution (login to Google Drive, set everything to “Public on web”, copy share link, convert it into the gdriveurl.com textarea in the homepage), but it’s just a waste of time, you should try “MyDrive” api.

    You should write a post about it. It’s more user/mobile friendly and complete.

  • I could not get this to work for me, but this discussion from 2012 worked for me so well.

    “Yes, it’s possible. Provided that you put your files in a public folder, you can get any file in a folder by this URL:

    https://googledrive.com/host/FOLDERID/FILENAME
    stackoverflow

Show more comments

Log in to comment on this story!