Place image in html that is in google drive

Asked

Viewed 10,597 times

1

  • tried to use this url: https://lh4.googleusercontent.com/eLMEVklGAYfVE2XqNJwR7O2lpK9mPJMjvJVH8K6ygZJTOVBOJLOmHfbxIJZ8PgRt7MoBtU-iN-t_1ZI=w1366-h638

  • tried, this url changes after a while, or is no longer available.

2 answers

5


1

Well if image switches, it can be some kind of google security to protect files, or if you want to use an image of the drive on your site google provides iframes, which is not ideal for images. I will upload this same photo on my drive to illustrate.

after upload I will open with 'google documents'

already in the documents I click on 'files' and then on 'publish to the web', I select the embed option and click on publish, result

<iframe src="https://docs.google.com/document/d/1or6gRFf8L9LyyqTHfTsqVKmKJGG1HfvqZMULY6oxIro/pub?embedded=true"></iframe>

That doesn’t make any sense

however at the time of generating iframe I came across another url in the same, when going to it you will see the photo in document form, when clicking only the photo to open in a new tab it generated an extensive url, which can be immutable but not sure...

<img src="https://lh6.googleusercontent.com/6-VhBBB5rPL_zMXXcgidUmDUcfhzGvInaXJoktZE-1Lk0eDdNDkElcyqXGyr04p3NWyamDRloz_a73IjY3VDofxmY8EwjX9lwcX6EIcKZdb7NFkxu9ZW4SYqBR_6gqKgDvfZIAj6" >

however, unless it is business rule, do not recommend using images hosted on the drive.

  • This solution works, but it’s more work than the solution I found later, thanks for the help.

  • Denada haha, what valley is the shortest and simplest way.

Browser other questions tagged

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