honeymoon
honeymoon

Reputation: 2520

Google drive display imag urls in web app

I have stored a bunch of images on google drive via the Desktop app under G:\google_drive\sdr\pos.

The images names are stored in a database (image1.png, image2.png, image3.png).

How can I use an url and display the images in my streamlit app? The google drive url does not contain the image file name: https://drive.google.com/file/d/1AWhXeAGB8qBWe9kItc5zW9eLytIguOQF/view

How to link the url automatically to the image files?

Upvotes: 0

Views: 535

Answers (1)

Bryan Monterrosa
Bryan Monterrosa

Reputation: 1470

You'll need to format the URL using a different structure, I found some examples,

  1. Identify the ID of the file, in this case 1AWhXeAGB8qBWe9kItc5zW9eLytIguOQF.
  2. Use this template https://drive.google.com/uc?export=view&id=YOUR_ID
  3. Result: https://drive.google.com/uc?export=view&id=1AWhXeAGB8qBWe9kItc5zW9eLytIguOQF

Sample:

Code:

<img src="https://drive.google.com/uc?export=view&id=1AWhXeAGB8qBWe9kItc5zW9eLytIguOQF">


I found this solution here.

Upvotes: 0

Related Questions