Categories: Uncategorized

Announcing Google Drive Site Publishing

Would you like to programmatically publish some web content? Or let your users do so in the context of your Drive app?

This is possible now with Google Drive. Your app can now insert static web assets in a publicly shared folder, and then serve those files directly to users via file names in a relative path. Google Drive site publishing supports JavaScript, so it’s even possible to run a JavaScript Drive app directly from Drive.

Publishing from Drive is a simple, two-step dance: create a public folder and use a link to the root folder — the webViewLink — to publish its contents. You can refer the Drive SDK documentation for full detail on how to work with public folders and content links, but basically the requirements are:

  • The folder containing site assets must be public. Assets added to public folders must also be public on the web.
  • Link to the files contained in the folder using the webViewLink (included in the folder’s JSON representation).

It’s important to emphasize the added simplicity provided by a webViewLink: using this link as a starting point, you can extend the path to any web asset in any subfolder without worrying about retrieving the exact file ID. What used to look like 0B2Gk2F2ImIBiaUkwY3JNX1JMaTg is now a recognizably cute path such as images/kittens.jpg. For the root path to the folder, we’ll display a list of files in the folder, or, if you have an index.html file in your folder we’ll load that as expected.

To see Google Drive site publishing in action, check out this example site served from Google Drive at https://googledrive.com/host/0B716ywBKT84AcHZfMWgtNk5aeXM.

 

The ability to publish files this way opens lots of possibilities for Drive app developers. Writing a blogging tool, creating a process to publish updates to shared docs, outputting images in a folder in a gallery page — any Drive use case that involves presenting a file in a browser can benefit from site publishing.

Via: Google Apps Dev Blog

Team TechPanda

Recent Posts

NCoE for AVGC-XR promises to reshape India’s gaming sector similar to IITs & IIMs transforming engineering & management

The Union Cabinet, under the leadership of Prime Minister Narendra Modi, has sanctioned the creation…

18 hours ago

The role of AI & Machine Learning in HRM: Beyond automation

The roles of Artificial Intelligence (AI) and machine learning in Human Resource Management (HRM) today…

2 days ago

A high res multispectral payload delivering the largest area coverage from India

Bangalore based KaleidEO Space Systems, a subsidiary of SatSure Analytics India Pvt Ltd, launched its…

3 days ago

Who’s who at Horasis India Meeting 2024 in Athens

Horasis India Meeting convened its 16th annual meeting on September 15th-16th in Athens, Greece. The…

4 days ago

M&A: The art of the deal

The Tech Panda takes a look at recent mergers and acquisitions within various tech ecosystems…

7 days ago

Big tech can’t risk being left out of the AI race even if it means over investing in it

With the Artificial Intelligence (AI) hype getting louder and louder, big tech has no choice…

1 week ago