1

yesterday I created a simple "quote of the day" script for my google site. The script reads the quote from a google sheet. I also wanted each quote to go with a companion image, which I host in my google drive (the image Ids also are stored in the sheet).

I followed the instructions explained here, and everything seemed to work fine. The permissions for the images was "everyone with the link within my institution" (this is supposed to work in a website on the google apps for education).

It was a success, because the images did display correctly.

Today I opened that page again, and the images have disappeared.

I know that image hosting was discontinued in 2016, but I think it was a different way of hosting (no permalink). Indeed, as I mention, yesterday I could see the images in the website.

Also, when I write the "permalink" in chrome address bar I get "403. That’s an error. We're sorry, but you do not have access to this page. That’s all we know." This happens despite I'm the owner of the file, and I'm logged in the correct google account. Also, it happens irrespective of the browser and/or machine I use (I tried with my phone too).

I also tried what explained here, although I'm not sure I understand that completely. There should be a problem though, because instead of the image I get the alt text (NA).

Is the "permalink" method still supposed to work? Could this be a problem of excessive traffic? I haven't even published the page yet, I only did some testing...

What is the best way of displaying images from google drive into google sites, without resorting to third party services?

Thanks a lot

Francesco

PFB
  • 177
  • 2
  • 13
  • Me again. I do not think this is a matter of traffic, as I read in a different post. I tried with a completely new image, which I loaded in drive just moments ago. The image does not display in the website nor in the browser (when I used the modified link). – PFB Oct 22 '17 at 13:25

2 Answers2

3

You already answered your question. Hosting on Google Drive has been stopped.

However, you can try the workaround from this SO post where you'll use the URL:

https://drive.google.com/uc?export=view&id={IMAGE_FILE_ID}

It worked fine when use with the <img src="{IMAGE_URL}"> HTML tag. That's the closest thing to what you're trying to do.

You can also try Firebase Storage where you host your images on the cloud and display them on your web page.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • 1
    Noogui, thanks for your reply. Perhaps I was not entirely clear, but what you suggest **is what I am actually doing from the start**. That is, I'm using `https://drive.google.com/uc?export=view&id={IMAGE_FILE_ID}`, where `{IMAGE_FILE_ID}` is something like `0Bw56O_ircsfpYVF1bERZa2NQZVk`. As I mention, at first (=two days ago) it worked but later (=yesterday) it stopped working. Should I conclude that it is a matter of traffic quota? If so, I guess I still deserve the downvoting, which otherwise seems a bit harsh. – PFB Oct 23 '17 at 12:33
  • Me again. Of course I know that I can resort to third party services for hosting my images, but my question was about doing that **in google drive**. One of the links you provide mentions a public folder in drive. I'll look into that. Also, assuming that the above problem is due to traffic restriction, where can I find a clear policy about that? Thanks again. – PFB Oct 23 '17 at 12:39
1

This is at least a partial answer to the problem I tried to explain, which I'm summarizing below:

  • I was hosting images for a page in my google site on my google drive, via the syntax

    https://drive.google.com/uc?export=view&id={IMAGE_FILE_ID}

  • the sharing settings of the individual images was "anyone with the link within [my institution]";

  • this worked for one single day and then stopped working: the images stopped showing, and I could not figure out why. All this happenened a few days ago (oct 21-22 2017), and hence cannot possibly have to do with google discontinuing a previous service, which happened in 2016;

  • this happened despite I was logged into the account in my institution (and hence the owner of the images).

I found out that the problem appears to be in the sharing settings. Apparently, the images only display if their sharing settings are "public on the web" or "anyone with the link". Instead "anyone with the link within [my institution]", or more restrictive settings won't work. The first settings were mentioned in the webpage I linked, but I thought it would also work with "anyone with the link within [my institution]" (and, for one day, it did).

I also tried by setting the permissions of the parent folder. In that case only "public on the web" would work. With anything more restrictive than that the images won't display.

Despite I carefully double checked all this, I think this permissions thing seems to be a bit erratic though.

As I mention, on the first day (oct 21) the images would display even with "anyone with the link within [my institution]. I could swear on my life that, before the systematic tests I just finished carrying out, all was working with the folder settings to "anyone with the link [within my institution]". Now that setting won't work.

I know, I said "it appears" a bunch of times. This is because all of this is just from my point of view, so far. I still have to share the link of the page I'm preparing. As soon as I can I'm going to ask a colleague to take a look at it. What I anyway want is that the page displaying the images is visibile only to people within my institution, for the moment being.

However, now I'm at least able to see the images hosted in drive, in my website.

Community
  • 1
  • 1
PFB
  • 177
  • 2
  • 13