Skip to main content

Get a direct link to files hosted in Google Drive

Update [10/2/2016]: It appears that Google has finally put a stop to this trick.

Update [11/7/2016]: Looks like Jonathan in the comments has figured a new way to do it!

Update [2/7/2017]: The website http://gdurl.com works too!

Imagine you want to use a QR code so guests at Parents’ Night can scan the code and stream video or audio straight to their mobile device. If you share the files in Google Drive, users will be taken to a Google page where they have to download the file first. But if you can create a link that points directly to the file, users can access the content right in their mobile browser.

Direct link files in Google Drive
Direct link to files in Google Drive

Turns out you can do this while still using Google Drive. Any public folder in Drive can host files and provide direct links to the files.

How to create the hosting URL:
https://googledrive.com/host/FolderID

This will provide a folder that will give direct links to files inside the folder.
Note: hosting view will not display files created in Google Docs.

Example:

Once in the hosting folder, you can right click on any of the files to get a direct link to the file.

33 thoughts to “Get a direct link to files hosted in Google Drive”

  1. Direct links like this for files doesn’t work for me since today :/

    Any idea why? Folder and files are set to be public.

  2. Like Casu, this has stopped working for me.

    The Drive UI still shows a “Hosting” URL – but it yields a 403 (permission deinied).

  3. You can also just plug the file ID itself into the hosting URL scheme (sharing must be set to either Anyone with link or Public on the web).

  4. It only works for a certain time (calls) with “/host”.
    After that it redirects to a 404 page!

    Any solutions?

  5. does not work like suggested any longer. recieving a 404 and cannot any longer even find the hosting url for forwarding from my domain server….inyone know why>

  6. My experience is that the direct link stopped working sometime after Google’s official shutdown of hosting on September 1, 2016.

    Before the shutdown I was able to use the url root as suggested by Dale
    http://googledrive.com/host/0B4gwdXQk1LyieHZHSTBqd0VJSnc/

    For example this would work before the shutdown
    http://googledrive.com/host/0B4gwdXQk1LyieHZHSTBqd0VJSnc/i30-dallas/construction/20150208-horseshoe-9146-1050.jpg

    but now I get a 502 error.
    Is the direct link definitely still working for anyone out there? If so, how are you doing it?

    1. For me also stopped working, I am desperate because I really need this. Do you know any alternative?

    2. I found that using this link: https://docs.google.com/a/example.com/uc?id= in place of http://googledrive.com/host/ works. Note that I’m using a Google for work account where example.com is my work domain, I haven’t discovered what link to use for personal a gmail account yet. So in your example above, I just need to add the file id to the end of this link:

      https://docs.google.com/a/example.com/uc?id=

      Checkout the drive files API to achieve this in a script if you have a bunch of images you need to relink to: https://developers.google.com/drive/v2/reference/files

      I write integration scripts for a living so if you need professional help, do reach out as well.

  7. So I think you still can share a public link to directly access the file in a shared folder on Google Drive, say a picture file. You can use the following URL prefix:
    https://docs.google.com/a/example.com/uc?id=
    Then the ID is the id you get when you right-click the picture/file and click “Get Shareable Link”. In my case, I was getting the following:
    https://drive.google.com/open?id=0B1kk0l_Tp7fWYnhMVVdMTWxnYVU
    And so to access the file via a diret link, I now use:
    https://docs.google.com/a/example.com/uc?id=0B1kk0l_Tp7fWYnhMVVdMTWxnYVU
    Not sure how long this will work, but it seems to do the trick.

  8. So I think you still can share a public link to directly access the file in a shared folder on Google Drive, say a picture file. You can use the following URL prefix:
    https://docs.google.com/a/example.com/uc?id=
    Then the ID is the id you get when you right-click the picture/file and click “Get Shareable Link”. In my case, I was getting the following:
    https://drive.google.com/open?id=0B1kk0l_Tp7fWYnhMVVdMTWxnYVU
    And so to access the file via a direct link, I now use:
    https://docs.google.com/a/example.com/uc?id=0B1kk0l_Tp7fWYnhMVVdMTWxnYVU
    Not sure how long this will work, but it seems to do the trick.

Comments are closed.