Host images to an HTML in Google Drive

Asked

Viewed 17,484 times

2

I have a simple question, but I still haven’t found the exact reference to solve it. I just know that there is the possibility.

I want to host an image for an HTML in Google Drive to be accessible from the URL. So my HTML will look something like this:

<img src="Url_Google_Drive" alt="example">

URL would be something like: https://drive.google.com/open?id=Id_Sua_Imagem

However, using the URL generated in the google drive share does not exactly work when loading HTML.

I know you have a parameter (probably 'open?' ) in the URL that should be changed to work correctly but I couldn’t find which parameter is.

They would know to inform me?

2 answers

4


I got a very simple solution of hosting images on Google Drive for some HTML. A very simple way to do this is:

1º - Mark your folder where the images will be in Google Drive as Public (Sharing => Advanced Settings)
2º - Use the link to share the generated image (in enable link sharing)
3º - In your html SRC <img> use the share URL generated by Google Drive
4º - In the url, change the section 'open?' for 'uc?'

Ready. Simple and functional.

I left the question here to help colleagues...

  • good afternoon can you tell me how long this link is in the air? I am using a newsletter and I need you not to get off the air so soon... Does anyone know how long?

-1

An image generated in google drive, generates a link

https://lh5.googleusercontent.com/id_da_imagem

But to get this link is kind of complicated, you need to go on share, and click on Get shareable link and right-click the image and copy the image address.

ai can use the image in html src I do not know if it is feasible.

  • for the image to open in html it was necessary to change the Open for uc. That worked. Thanks for your help there.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.