How do I display images from Google Drive on a website?

前端 未结 17 1948
傲寒
傲寒 2020-12-02 05:35

A client of mine has uploaded some photos to their Google Drive and would like me to display their photos on their company website. I reviewed the documentation for displayi

17条回答
  •  無奈伤痛
    2020-12-02 06:17

    From google drive help pages:

    To host a webpage with Drive:

    1. Open Drive at drive.google.com and select a file.
    2. Click the Share button at the top of the page.
    3. Click Advanced in the bottom right corner of the sharing box.
    4. Click Change....
    5. Choose On - Public on the web and click Save.
    6. Before closing the sharing box, copy the document ID from the URL in the field below "Link to share". The document ID is a string of uppercase and lowercase letters and numbers between slashes in the URL.
    7. Share the URL that looks like "www.googledrive.com/host/[doc id] where [doc id] is replaced by the document ID you copied in step 6.

    Anyone can now view your webpage.

    If you want to see your image in a website embed the link to pic in your html as usually:

    
    
        
            
            Example image from Google Drive
        
        
            

    Example image from Google Drive

    whatever

    Note:

    Beginning August 31st, 2015, web hosting in Google Drive for users and developers will be deprecated. You can continue to use this feature for a period of one year until August 31st, 2016, when we will discontinue serving content via googledrive.com/host/[doc id]. More info

提交回复
热议问题