Skip to content
Advertisement

How to embed Google Drive images into a webpage?

I have a website that I am designing and I want to use a folder in a google drive to store the images. The issue is that I can’t seem to find how to get the URL for these images. The actual use of this needs to be that anyone with permissions for the google folder can drop in an image and it will show up when you load the page.

I have the php looping figured out and I am just short the path for the <img src="" >.

At the moment even just getting one image statically from google drive would be a start.

Advertisement

Answer

If I understand what you are aiming for, it’s pretty much hosting the images from the Google Drive. Looked around the community and found some stuff that I think is what you’re looking for or at the very least, can help you have an idea on how to do it.

First, is from this answer. You just have to use this URL format:

https://drive.google.com/uc?export=view&id=<fileId>

— providing the file ID. There is a note though, Note: this link seems to be subject to quotas. So not ideal for public/massive sharing. But this proves that you can retrieve the files (in your case, images) from the file drive.

Second, is the top answer from the same post as above. Simply states that it is very much possible, provided that you put the files in a public folder, then retrieve it using the following URL:

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

Lastly, is to follow the tutorial video. It’s similar to the second answer where the image should also be shared publicly (haven’t really tried to tweak around, try it out maybe it can also work if it’s only shared selected users), get the shared link and use gdurl.com which will turn the shared link and turn it into a hosted link which will be a direct link to the image.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement