You'll need to grab the ID of the image. Easiest way on the desktop is to right click the file, dive into the Google Drive subcontext menu and choose View on the Web. Grab the string of characters from there and replace the XXX in the code below with it.
-
-
Save evansims/f23e2f49e3d4be793038 to your computer and use it in GitHub Desktop.
<a href="https://drive.google.com/uc?export=view&id=XXX"><img src="https://drive.google.com/uc?export=view&id=XXX" style="width: 500px; max-width: 100%; height: auto" title="Click for the larger version." /></a> |
Is there a way to host folders and folders of images without needing to get a link for each image with Google Drive? Thanks!
thank you!
Hello, since the Google Drive interface has now changed and doesnt allow advanced sharing options, I am not able to link Google Drive images to my website using HTML and CSS using this solution. Does anyone know what I can do?
The code I get after publicly sharing my image looks something like this. PS- I am just providing the link below for reference and have changed a few letters from the original ID so it wont work on your computer
https://drive.google.com/file/d/1_mdyuy_RGoY_FejdIpCWWtUc0Qn7MQyl/view?usp=sharing
Saved me a ton of time, thanks!
New format that works in 2021 is. You need to be a g suite user though and file needs to be in a publicly shared folder
img src="https://drive.google.com/a/YOURDOMAIN.COM/thumbnail?id=YOUR_FILE_ID&sz=wYOUR_DESIRED_WIDTH"
Thank you so much @evansims! 😃👍
anyone looking to strip the id from a url this worked for me
var url = https://drive.google.com/open?id=yourID
var id = url.field2.split("?")[1].split("id=");
console.log(id[1])
Thank you so much @ildarius.
I resolved the image showing problem from google drive.
Thank you so much for this!! It's working fine!
Thank you !