Google Drive broke the ability to embed images with the /uc path. Here’s how to embed images from Google Drive in your website.
Previously Google Workspace developers could use a
/uc path for embedding images and other files hosted in Google Drive. For example, images could be embedded in websites and emails using markup like:
<img src="https://drive.google.com/uc?export=view&id=1234567890abcdef" />
To my knowledge this was never an officially documented endpoint, but widely known about and shared within the community. Back in October 2023 Google announced Upcoming changes to third-party cookie requirements in Google Drive, which has started rolling out from the beginning of 2024.
The impact of this change is it breaks
/uc embeds and these have started returning 403 errors. There is no reference to the
/uc endpoint in the original announcement, which is why I think many people are only just finding out about the impact now. Google’s official guidance is to move to
<iframe> with Google Drive publish and preview links. This post from Justin Poehnelt discusses the options and limitations for images.
There has also just been another announcement in the AppSheet community that Drive download URLs for embeddable content to be updated by May 1st, 2024. This is an extended window for AppSheet users and where possible Google will be emailing affected app owners where
/uc urls have been detected. This announcement includes a link to a help page with tips for finding
/uc occurrences in your AppSheet apps.