Skip to main content

Host Static Images For Apps or Website on Google Drive Free (Hotlink to GDrive images)

banner Google Drive provides Gmail users with a convenient way to store and order files online. Files stored on Google drive can be easily shared, viewed and downloaded by others. In this post, I will be sharing an easy way for developers to use drive for hosting images for small projects.

How To Use Drive Images on Any Website

  1. Login to google drive and go to the folder where you have uploaded the images.
  2. Right click on the gdrive image you want to use.
  3. Click on Share. One popup will appear with sharing options.
  4. Click on advanced (button on bottom right)
  5. A screen with sharing link appears. You will see a link 'Change' under Who has access.
  6. Select the first option On - Public on the web. 

Now your image is available publicly and can be shared or used anywhere on your websites. With this anyone can see this image without login to Google Drive. Let's use this image now on our website now.

  1. Double click on image again.
  2. Click on three dots on top right and click on open image in new window.
  3. On new tab you will see a URL like this: https://drive.google.com/file/d/1hv9Mt2oC-y1dBPtHoHttpuiK8Qe2AhVS/view
  4. Copy the ID i.e. after d/ and before /view. In Above example it would be 1hv9Mt2oC-y1dBPtHoHttpuiK8Qe2AhVS
  5. Replace the copied id with ImageID from below and use the created URL as src of image anywhere.
https://drive.google.com/uc?export=view&id=ImageID

The resulting url would be something like: https://drive.google.com/uc?export=view&id=1hv9Mt2oC-y1dBPtHoHttpuiK8Qe2AhVS.

Or paste your ID in below imput box and Click on Generate.
Full URL
Result
Note: The Banner image on this post is hosted on Google Drive.

Comments

Popular posts from this blog