Hosting CSS or Javascript File in Google Drive

This is just quick note on how to use google drive to host our css/javascript file. After get the direct URL then we can used in our website.

1. Upload css/javascript file to google drive.
2. Click Share > Public on the web
3. Copy “link to share” and do some change to the URL.

i.e the link to share is

https://drive.google.com/file/d/0B4n9GL3eVuV-TkphMkc3SFR2ghj/edit?usp=sharing

CHANGE above link to

https://googledrive.com/host/0B4n9GL3eVuV-TkphMkc3SFR2ghj

Keep the key part  “0B4n9GL3eVuV-TkphMkc3SFR2ghj” and remove others. Add

https://googledrive.com/host/

before the key part. And now you have direct link to your CSS/Javascript on google drive.

UPDATE 19 Mei 2016
How to get direct download link from uploaded file on Google Drive?

  1. Right click uploaded file > Get shareable link
  2. Copy share link and change with below rule
 https://drive.google.com/file/d/FILE_ID/edit?usp=sharing

To

 https://drive.google.com/uc?export=download&id=FILE_ID

Now you get direct download link for your file on google drive. This trick only works for uploaded file. Not, file created using Google tools.

Update 24 Oktober 2017

Berhubung direct link dari google drive tidak bisa lagi, maka alternatif free hosting untuk file js, bisa menggunakan layanan gratis dari http://yourjavascript.com/

Advertisements

Tinggalkan Komentar

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s