Skip to content Skip to sidebar Skip to footer

Load Image from Google Drive into HTML img src without Web Hosting

Cara load image dari Google Drive ke img src HTML

Hello meet me again with zooba.ID. Loading image to HTML IMG src is very easy. You need to post your image online first. You can follow this step to do it, without web hosting! We only need Google Drive. As we know renting web hosting is not cheap, so this alternative can make your project run without any problem.

First, upload your image to your Google Drive. Make sure you press share button (chain) and set the setting like this:

Cara load image dari Google Drive ke img src HTML

After that, you can open your image in another tab. pay attention to address bar in your browser. You will get url with specific ID, for example like this: https://drive.google.com/file/d/1Q_tu747Wbs7kfU4kCX0iy03_UmUHjtKV/view  you will see 1Q_tu747Wbs7kfU4kCX0iy03_UmUHjtKV is the file ID of my picture. 

Cara load image dari Google Drive ke img src HTML

You cannot use the link into img src directly. It will show error. You need to do the following steps. After that, copy the file ID and add it after https://lh3.googleusercontent.com/d/ like this one:
Cara load image dari Google Drive ke img src HTML

It will become https://lh3.googleusercontent.com/d/1Q_tu747Wbs7kfU4kCX0iy03_UmUHjtKV that is my img url. The last step just add the link into your code img src like this:

<img src="https://lh3.googleusercontent.com/d/1Q_tu747Wbs7kfU4kCX0iy03_UmUHjtKV"/>

And the image will be shown like this in your web:


Post a Comment for "Load Image from Google Drive into HTML img src without Web Hosting"