9

I am working on an intranet that requires user authentication to access private folders on the logged in user's Google Drive. Images are pulled from folders and displayed in the intranet using the image's WebViewLink. This works fine in Chrome and Safari, but does not seem to work in Safari or Internet Explorer. Safari gives me a "too many redirects" error. In IE I don't see any errors, but the images are not displayed. I tried looking for any errors in the Network tab but couldn't locate any.

However I found that, if I copy the WebViewLink for one of the images, and paste it into the browser's address bar, the image is displayed successfully. If I go back to the web application and refresh the page, the error goes away and all images are successfully displayed. This only works for Safari and does not work for Internet Explorer.

Images and their parent folders can not be public; all data is sensitive and must remain private. Has anyone encountered this issue and found a resolution that always works? I tried loading the images in an iframe that did not work.

Please let me know if you require more information. Thanks!!

Sandra M
  • 91
  • 1
  • 2
  • 1
    Adding a few updates: viewing the image URL in a new tab, then refreshing the application DOES load all images in IE as well as Safari. This is not an acceptable fix though. I have also used the `http://drive.google.com/uc?export=view&id=FILEID` link as indicated below by @adgdj and that does not work either. – Sandra M Feb 16 '16 at 18:06
  • We are having same issue only with Safari, with an ajax/jsonp call using the Ur like https://drive.google.com/uc?export=download&id=FILEID No idea how to avoid it or fix it. – Fausto R. May 09 '16 at 14:30
  • Hi @SandraM, did you ever find a solution for this issue?, Thanks – Fausto R. May 23 '16 at 19:31
  • @FaustoR. Yes I did find a solution that is working at all times. I don't even know how I figured this out! It was like two weeks later, super late on a Thursday night and I was losing it... so this is the solution that I found: `https://googledrive.com/host//` – Sandra M May 25 '16 at 02:54
  • 1
    Thanks @SandraM, I am sorry to bring you the bad news: that solution will work only until this August, Google has deprecated the web-hosting feature in Google Drive - see this link: https://support.google.com/drive/answer/2881970?hl=en – Fausto R. May 25 '16 at 13:24
  • @FaustoR. yup! Dealing with this issue now! Did you find another solution? Really not happy about dealing with this again! – Sandra M Aug 08 '16 at 17:17
  • 1
    No @SandraM, I am still having the same issue with Safari users, at least some of them – Fausto R. Sep 06 '16 at 11:45
  • 1
    nothing? I still have that error with safari (iOS) users – pabloverd Mar 04 '19 at 19:16
  • 2
    Solved: "https://drive.google.com/thumbnail?id="+ID+"&sz=w1000" – pabloverd Mar 05 '19 at 17:31
  • use thumbnail works! – Alberto Acuña Feb 25 '22 at 13:23

2 Answers2

0

This is because WebViewLink property is only returned on public folders for viewing their static web assets (HTML, CSS, JS, image files, etc) and not the single files inside such folders.

The support for files that can't be edited using Google Drive is limited. Google doesn't offer permalinks for images. Example, if you check the source code of a page or use features like Firefox's "view page info", you'll get a link that doesn't work. You need to replace this URL-http://docs.google.com/file/d/FILEID/edit from the address bar with http://drive.google.com/uc?export=view&id=FILEID where FILEID is a long sequence of digits and letters.

Also, be noted that Google Drive won't work with Chrome 23, Firefox 23, IE9, Safari 6, or older versions. You'll need to update your browser to use Drive.

abielita
  • 13,147
  • 2
  • 17
  • 59
  • 1
    Thanks for your response. I initially was not using WebViewLink and I was using `http://drive.google.com/uc?export=view&id=FILEID` where `FILEID` is the ID of my image file. That was not working in Safari either, so I changed it to use WebViewLink. I guess I'll change it back and see if it all of a sudden starts working, or check if there was a different issue that might be easier to resolve. – Sandra M Feb 16 '16 at 13:08
  • 1
    Even using the above link I get the same error message "Failed to load resource: too many HTTP redirects" – Sandra M Feb 16 '16 at 14:36
0

I have been having this problem as well. One thing I did find was that this does not happen when using private browsing mode so it's related to one of the cookies google is storing in your browser. When I cleared all the cookies the images loaded perfectly. Same behavior on mobile safari as well.

Pat W
  • 36
  • 2