Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Google drive pictures are not showed in website

onur_super_ai

New Coder
Hello,
I am new to javascript coding. I am displaying the table in the google sheet on the web with js. It pulls the data properly, but my pictures in google drive cannot be displayed properly in the last column in the table. When I get a link to any image on the internet, the image appears, but there is a problem with google drive image links.


Could you you help me?
Thank you very much.
 
Hi there!
It sounds like you're doing a great job so far! The issue with Google Drive images is that their default sharing links don't work directly as image sources. You need to make sure the images are publicly accessible and then modify the link to be "direct."
Here's how you can fix it:
  1. Go to your Google Drive, right-click the image, and select "Get link."
  2. Make sure the sharing setting is set to "Anyone with the link can view."
  3. Convert the link using this format:
Bash:
Original link: https://drive.google.com/file/d/FILE_ID/view?usp=sharing
Direct link: https://drive.google.com/uc?id=FILE_ID

Replace FILE_ID with the actual file ID from your link. Use the direct link as the src in your &lt;img&gt; tag, and the image should show up in your table.

Let me know if you get stuck!
 
Thank you very much
Hi there!
It sounds like you're doing a great job so far! The issue with Google Drive images is that their default sharing links don't work directly as image sources. You need to make sure the images are publicly accessible and then modify the link to be "direct."
Here's how you can fix it:
  1. Go to your Google Drive, right-click the image, and select "Get link."
  2. Make sure the sharing setting is set to "Anyone with the link can view."
  3. Convert the link using this format:
Bash:
Original link: https://drive.google.com/file/d/FILE_ID/view?usp=sharing
Direct link: https://drive.google.com/uc?id=FILE_ID

Replace FILE_ID with the actual file ID from your link. Use the direct link as the src in your &lt;img&gt; tag, and the image should show up in your table.

Let me know if you get stuck!

Thank you very much for your attention,
The reason why the image is not displaying properly is that the link format below is incorrect.

Wrong format

Correct format
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom