Managing Versions and Displaying Images from Google Drive

I use Google Drive to save and share documents. With Google Drive one can upload big files and share them with people. Often times I’ll host files on Google Drive and create links to those files on web pages. If I need to update one of those files I don’t need to worry about running around trying to update all the links because I know a little secret about Google Drive, you can upload revisions!

This allows you to use the same share link but update the file that the link points to. I used this technique on my ALC One Pagers post. In that post I’ve linked to 6 different PDFs and 5 images, all hosted on Google Drive. If I ever need to update any of these files I do it through Drive using manage version and the links in my post will automagically point to the most recent version.

In this post I will go over how to manage versions using Google Drive and I will show you how to create links to picture files so you can display them on your pages.

Manage Versions

I’ll assume you’ve already gotten a folder in Google Drive and placed some files in it. Remember you can only manage versions of files like PNG, PDF, JPG not Google docs or spreadsheets (those are managed through the doc).

google drive folder

I want to add a link to one of my PDF files.

  1. Change the sharing settings on the file so that “Anyone with the link can view
  2. Copy the share link

The link looks like this:

https://drive.google.com/open?id=0BxX8hMn15JGNdktpZVJkWlZ2VlE

Then I just make it into a link on my post and now if anyone clicks that link they will go to the above URL and get the PDF!

Great, but now someone downloads the PDF and tells me there is a typo! Rather than upload the fixed version, delete the old one, then update the link I can just upload a new version.

Let’s go back to our Google Drive folder, find the file you want to update and right click:

google drive manage version dialog

In the pop up menu find Manage versions… and click that.

google drive manage version pop up

Click Upload new version and select the updated file.

This will update the file and now when the link on this post is clicked the new version will be downloaded!

Do the same with images

In my ALC One Pagers Post I also have images of each of the PDFs. I want to use the images directly from Google Drive so that if I need to update them then they will update across all references to them.

First we need to build the link, this is a little bit technical, but you’ll be able to do it!

Make sure the images are in their own folder and that the folder is shared publically.

Here’s the pattern that we are going to use to create our image’s URL:

https://googledrive.com/host/folderID/filename

The folderID is the long string of characters that represents your folder. Navigate to your image’s folder and grab the folderID from the URL.

Screen Shot 2016-08-13 at 8.45.50 PM

Now we just need the filename:

https://googledrive.com/host/0BxX8hMn15JGNN0w4YXhaazZ0NDA/filename

Now you just add the file name on the other side of the “/” slash.

google drive file name

Cool, now the URL looks like so:

https://googledrive.com/host/0BxX8hMn15JGNN0w4YXhaazZ0NDA/alc-tools-one-pagers_alc.png

Check it out! It works:

Now when I update the version of this file it will change no matter where it’s posted!

The post Managing Versions and Displaying Images from Google Drive appeared first on Drew the ALF's blog.