I was wondering if its possible to access/display files like images which are stored in Google Drive on a public website.
Active10 months ago
Learn how to embed any image from your Google Photos album directly into your website, email templates. Google Photos as an Image Host. Google Drive Hosting is now deprecated. It stopped working from August 31, 2016. Hosting on Google Drive - deprecation schedule. I have removed the explanation of how to previously host an image on Google Drive.
Habeeb Perwad
3,5081212 gold badges6666 silver badges113113 bronze badges
user1355487user1355487
1,25633 gold badges99 silver badges33 bronze badges
16 Answers
A workaround is to get the
fileId with Google Drive SDK API and then using this Url :
https://drive.google.com/uc?export=view&id={fileId}
That will be a permanent link to your file in Google Drive (image or anything else).
Note: this link seems to be subject to quotas. So not ideal for public/massive sharing.
ruforufo
3,00422 gold badges3030 silver badges4040 bronze badges
UPDATE: As was announced, Google deprecated this feature in Aug 2016. Here's the final update from Google with alternatives.
Yes, it's possible. Provided that you put your files in a public folder, you can get any file in a folder by this URL:
user9355604
niutechniutech
20.6k1111 gold badges7575 silver badges8787 bronze badges
Here's the simple view link:
e.g. https://docs.google.com/uc?id=0B9o1MNFt5ld1N3k1cm9tVnZxQjg
3,8381212 gold badges4545 silver badges7878 bronze badges
here is how from @ https://productforums.google.com/forum/#!topic/drive/yU_yF9SI_z0/discussion
1- upload ur image
2- right click and chose 'get sharable link'
3- copy the link which should look like
4-change the
open? to uc? and use it like
4,58055 gold badges2626 silver badges3434 bronze badges
UPDATE: As was announced, Google deprecated this feature in Aug 2016. Mpl gamedownload computer. Here's the final update from Google with alternatives.
As per April 2013 and using Chrome/webkit, the following worked for me:
https://googledrive.com/..
One limitation is that as far as HTTP goes, only secure HTTP access seems to be possible.
Update:
Another limitation is that files which Google drive can open, won't be accessible that way. That is, clicking on 'Details' won't show an Google-drive url.
To overcome this:
Note: An alternative to the procedure above, is uploading the file with an extension that Google Drive cannot open/is not associated.
wescpy
7,40911 gold badge3535 silver badges3434 bronze badges
Lorenz Lo SauerLorenz Lo Sauer
16.7k1111 gold badges6868 silver badges8383 bronze badges
If you want to view the file in the browser, it's also possible using a similar method to the one provided by rufo and Torxed:
Jeff JohnsonJeff Johnson
I think it is possible but only for a short time
What you have to do is set the Access Control List of the file to Public Read-Only (or Public Read/Write). You can do that programmatically using the Google Document List API, or manually through the 'Share' button on the Drive image viewer.
Then you can get the URL to the image programmatically by either using the Google Document List API or using the Google Drive API (i.e. file.getDownloadUrl() in Java). You can also easily get a link to the image manually by right clicking on the image in the Google Drive default image viewer.
The problem is that this link has a limited time to live, so it will work for a little while and then stop working.
Basically the URL of the image file stored in Drive should be accessible without any authentication once it has been set shared publicly but that URL is going to change at some point. We might find a solution to this in the future like providing a permanent URL that will redirect to these changing URL but no promises..
Nicolas GarnierNicolas Garnier
10.1k22 gold badges3535 silver badges3737 bronze badges
From google drive help pages:
To host a webpage with Drive:
Anyone can now view your webpage.
gugolgugol
Some of the previous users were close, but they were missing a step here or there.
Here is a video that shows all of the steps.
(Edit 2-Dec-14
The Below information is incorrect when it comes to the new Google Drive. For the New Google Drive follow these instructions. There are two options you can use, option 1 you can click the cog on the top right and revert to the old google drive, IF you revert, use the instructions after 'End Edit)'. Option 2 or you can follow the work around I found. If I find a better way than this I will update it, but here is what I have found that works. The full link will look like this 'https://googledrive.com/host/(folder id) Part one of your link that you need is 'https://googledrive.com/host/' for the second half you will need to navigate to the file you would like to share. Once you are in the folder with the file you would like to share, look at the link above (Example 1 https://drive.google.com/drive/u/0/#folders/0B3UALYkiLexYSXZlcldoU2NpYXM ) (Example 2 https://drive.google.com/drive/u/0/#folders/0B3UALYkiLexYSXZlcldoU2NpYXM/0B3UALYkiLexYRkNnOVhsUVozRU0) In both of these above examples, the 'Folder ID' you need for sharing is the last group of letters and numbers after the '/' so in example one, it is '0B3UALYkiLexYSXZlcldoU2NpYXM' in example two it is '0B3UALYkiLexYRkNnOVhsUVozRU0' In the examples I used, example 1 was a folder on my drive, and example 2 was a folder inside that first one, that is why it has the entire first link before the second. We only need the section after the '/' furthest to the right. So now that you have your 'Folder ID', take the above formula 'https://googledrive.com/host/(folder id)' Example 1 https://googledrive.com/host/0B3UALYkiLexYSXZlcldoU2NpYXM Example 2 https://googledrive.com/host/0B3UALYkiLexYRkNnOVhsUVozRU0 Great, now that you have this link, open it in a new page. It will direct you to the shared folder. Once there you can either right click on any file and select 'Copy link address' or you can click any file in that folder and it will take you to the hosted image, the URL at the top of the page is the hosting URL. That is the how you do it. It is quite annoying, and personally it seems a whole lot easier to just revert to the old google drive. I will try to make a new tutorial video ASAP Let me know if this does not work for you and what problem you are experiencing. End Edit)
Or you can just follow the written ones below.
These pictures go with the ones listed in the steps.
user3642085user3642085
Vetea, if you take the link from picture URL, it does not work, but if you take it from the field 'Direct Link' it should work. I have used and tested it in multiple occasions.
JarzanJarzan
Solution provided by Niutech worked for me i.e.
But there are 2 outstanding issues Marsis playout 3.1.3 crack free.
Vijay RumaoVijay Rumao
There is a filetype option in the Google Drive API. You could, maybe, check if that resolves to a valid image. I'd look at an option where if the filetype gives me an invalid image, then get a new direct URL for the file. I haven't figured out exactly how to do this though, but maybe that's a path to try.
SaxSax
You can do it directly from Drive & Gmail. Here's how:
1.Upload an image to Google drive and set permissions for viewing (can be public OR anyone w/ link)
Jessica PotterJessica Potter
Con can disable javascript in your browser open the image file and in the view page source or right click on the image, you will see the image link. ( check share preference before )
binwillybinwilly
For images, open an image in google viewer. i.e.
then view source> find word 'texmex-thumb' and aside it there will be link.
T.ToduaT.Todua
34.6k1212 gold badges151151 silver badges150150 bronze badges
However this answer is simple, infact very simple and yea many have mentioned it that simply put the id of image into the following link https://drive.google.com/uc?export=view&id={fileId}
But however easy that is, I made a script to run in the console. Feed in an array of complete sharable links from google drive and get them converted into the above link. Then they can be simply used as static addresses.
Sagar MunjalSagar Munjal
protected by Shog9♦May 22 '14 at 8:50
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead? Not the answer you're looking for? Browse other questions tagged google-drive-api or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |