-2

Copying links directly from Google Drive and using on HTML pages but image does not show on web page.

<img src="https://drive.google.com/file/d/1PBXfGMt4AuAZGyMGvFpvdmHY5-K4azXi/view?usp=drive_link" alt="National Flag of Bangladesh" width="300" height="200">

How to Embed a Google Drive image in HTML?

Progman
  • 16,827
  • 6
  • 33
  • 48
  • Your URL you have added is not an image, it's a HTML file. You have to use an URL which points to an image. – Progman Jun 10 '23 at 15:27
  • You might want to look at https://www.labnol.org/google-drive-image-hosting-220515 on how to get/generate the correct image URL. – Progman Jun 10 '23 at 15:28
  • 1
    Does this answer your question? [Displaying files (e.g. images) stored in Google Drive on a website](https://stackoverflow.com/questions/10311092/displaying-files-e-g-images-stored-in-google-drive-on-a-website) – Progman Jun 10 '23 at 15:29
  • Does this answer your question? [How do I display images from Google Drive on a website?](https://stackoverflow.com/questions/15557392/how-do-i-display-images-from-google-drive-on-a-website) – Komeil Mehranfar Jun 10 '23 at 16:37

2 Answers2

0

No, you can't do it. Google Drive Is a place where you upload your files but it is not work like that. You have to upload your images on Imagekit.io or any other platforms

Kannu Mandora
  • 479
  • 2
  • 10
0

The encoded part "1PBXfGMt4AuAZGyMGvFpvdmHY5-K4azXi" in the Google Drive link URL is the Google Drive File ID, so you can take that File ID and replace GOOGLE_DRIVE_FILE_ID in the URL below:

<img src="https://drive.google.com/uc?id=GOOGLE_DRIVE_FILE_ID" alt="My Google Drive File ID" />
Claude COULOMBE
  • 3,434
  • 2
  • 36
  • 39