Jhalaa Chinoy
Jhalaa Chinoy

Reputation: 507

Acesing an image from google drive in google app script

We are using google app scripts for our project.We have to display images which are stored in our drive on our page.This is how we used to do it.

https://www.googledrive.com/host/File-id

This was working fine until a few days back when our images stopped being loaded and we started getting a 502 error.Any help/ideas as to why this might be happening would be most welcome.

Upvotes: 0

Views: 122

Answers (1)

Spencer Easton
Spencer Easton

Reputation: 5782

Web hosting in google drive has been shut down.

See:
http://googleappsdeveloper.blogspot.com/2015/08/deprecating-web-hosting-support-in.html

You can link to images in your drive using the URL:
https://drive.google.com/uc?id=FILEID

Here is a snippet of code from one of my projects:

$("#HeaderImage").html("<img src='https://drive.google.com/uc?id=" + imageId +"'style='max-width:100%'>");

If the image is not public the user will need to be authenticated and have proper permissions to the image.

Upvotes: 1

Related Questions