Thursday, September 25, 2014

Google drive: Host some CSS/JS files

This is how to store some web files in what Google calls the new Drive as of today, 25-09-2014.
Say we want to fetch some CSS file from a folder on Google Drive.
  1. Right click on the folder and select "Share..."
  2. Select "More..." in the popup dialog
  3. Check the "Public on the web" box
  4. A public URL is proposed in the following dialog
  5. The folder URL is of the form:

    https://drive.google.com/folderview?id=0B7uYPyj_NiVxYVltWjZ0VUVULTQ&usp=sharing.

    In order to use it in a web page, pick the id from the proposed URL and re-use it in the following new URL:
    https://googledrive.com/host/0B7uYPyj_NiVxYVltWjZ0VUVULTQ
  6. Then add the filename to be used, e.g.

    https://googledrive.com/host/0B7uYPyj_NiVxYVltWjZ0VUVULTQ/toto.css
Et voila.