February 8, 2013

Permalinks for Google Drive Images

While Google Drive lets you upload any file, the support for files that can't be edited using Google Docs/Sheets/Slides is limited. For example, you can embed PDF files and videos, but Google doesn't offer permalinks for images.

So you've uploaded a photo to Google Drive and the only options are to download the file and link to the image page. But what if you want to embed that image in a web page or simply post a direct link to the image? You may think that right-clicking the image lets you copy the image URL, but that's not true. Even 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.

Fortunately, there's an easy solution - replace this URL from the address bar:

http://docs.google.com/file/d/FILEID/edit

with:

http://drive.google.com/uc?export=view&id=FILEID

(where FILEID is a long sequence of digits and letters).

This only works if you've changed the visibility options to "public on the Web" or "anyone with the link" in the Share dialog.

Here's an example:


You can also use:

http://drive.google.com/uc?export=download&id=FILEID

to trigger a download and this works for any non-private Google Drive file, not just for images.

{ via Stack Overflow. Photo licensed as Creative Commons Attribution. }

40 comments:

  1. Copy Link Address and Copy Download Address should be menu options for selected files. All these hacky methods of doing what the UI should be providing are poor substitutes.

    ReplyDelete
  2. Funny thing but this image doesn't work.

    ReplyDelete
    Replies
    1. Try enabling third-party cookies (they're disabled by default in Safari, including the mobile Safari for iOS and all the other iOS browsers).

      Delete
    2. Try this: https://www.htmlkomik.tk/
      I have tested its success and it can

      Delete
  3. Could this be used to host podcast MP3 files? iTunes still requires an old fashioned file server...

    ReplyDelete
    Replies
    1. It should work for mp3 files, as well.

      Delete
    2. I heard on the forums that there's an invisible cap on bandwidth- they said that they wanted docs to be used for sharing, not hosting. Do you have any information about that? Because if it's gone, it'd save a lot of podcasters a lot of money ;)

      Delete
  4. Alex Chitu, thanks. What else are the settings?



    My script https://sites.google.com/site/oshliaer/getgddlink

    ReplyDelete
  5. Good image choice, Ionut ;-) #platypus

    ReplyDelete
  6. Thats Great blog :)
    my blog abuot lower back pain
    https://lower-backpain.blogspot.com

    ReplyDelete
  7. Nice tutorials. I didn't know about this, so gonna try.
    Oh by the way, hope we can be blogger friends at my inspirational Christian quotes blog.But, It is ok if you don't mind. Good luck.

    ReplyDelete
  8. Why does it have to be this convoluted?

    ReplyDelete
  9. does it still limited bandwidth with this https://drive.google.com/uc?export=view&id= ?

    ReplyDelete
  10. Thanks for the tip. I use this approach quite often! So often that I created a really simple tool for that. Have a look here: http://blog.codeleak.pl/2016/01/generate-direct-link-to-google-drive.html

    Greetings!

    ReplyDelete
    Replies
    1. Try this: https://www.htmlkomik.tk/
      I have tested its success and it can

      Delete
  11. It worked. But the image is too big, how can I make it fit the size given to it in my website. Thanks

    ReplyDelete
  12. Your website is really cool and this is a great inspiring article.
    selfie apps

    ReplyDelete
  13. Is there a way to post images to a forum or other site without editing tools showing up at the top? I've tried several but always get the same toolbar above the image - and it's active. Trying to get away from Picturetrail! Thanks -

    ReplyDelete
  14. BTW don't know why I show up as "unknown"! Thanks - Jim Sliff

    ReplyDelete
  15. Is there a way to do this for Google Photos? I'm trying to put Google Photos on a Google Map I'm making, but Maps won't see the URL shared out of Photos and finding the photo in Drive is just one extra step making this a long and tedious process.

    ReplyDelete
  16. I do this on videos it works!!,but suddenly it auto plays.
    Is there anyone here no how to disable it's autoplay?

    ReplyDelete
    Replies
    1. Try this: https://www.htmlkomik.tk/
      I have tested its success and it can

      Delete

  17. Hyper songs download

    <a href="http://www.crazyspeedtech.com/download-voot-app-android-a

    ReplyDelete
  18. I am very much glad after reading its website and blogsite. In this particular website we are taking Business between Saudi Arabia and United States into consideration how these countries all operate as well as manage the important things at ease. There are crucial facts Investing Saudi Arabia which all needs to be considered and once we all follow these things it will help the business as well as enhance all other possibilities to better new ways.
    For further info log in its website.

    ReplyDelete
  19. Wow, I was looking for the permalinks and I am glad that I landed on this site and found them. I hope to get the images soon and transform the appearance of my website which can be accessed by clicking on People that Edit Dissertation Proposals. Thanks so much for sharing this article with us. I am looking forward to reading more articles from this site.

    ReplyDelete
  20. write next articles referring to this article. I desire to read more things about it! read here 4liker apk download

    ReplyDelete
  21. The sites you have referred were good. This is a great article, that I really enjoyed reading. Thanks for sharing.
    http://tipsforapps.com/ace2three/

    ReplyDelete
  22. The post is explained clearly so that we are able to understand it clearly.
    http://tipsforapps.com/AbhiBus-apk/

    ReplyDelete

Note: Only a member of this blog may post a comment.