Open Any Document in Google Docs Via a Url

by Justin Ball on August 28th, 2008

We are looking at ways to integrate the new Teachers Without Borders site with Google docs.

Turns out that you can open:
documents - .pdf, .doc, .txt, .html, .rtf and .odt
spreadsheets - .xls, .csv, .ods
presentations - .ppt

By feeding the file url to this google url:

http://docs.google.com/?DocAction=updoc&formsubmitted=true&uploadURL=DOCUMENT_URL

Here's an example if you needed to view a W4 form from the IRS url:

http://www.irs.gov/pub/irs-pdf/fw4.pdf

Use this url:

http://docs.google.com/?DocAction=updoc&formsubmitted=true&uploadURL=http%3A%2F%2Fwww.irs.gov%2Fpub%2Firs-pdf%2Ffw4.pdf

http://docs.google.com/?DocAction=updoc&formsubmitted=true&uploadURL=http://www.irs.gov/pub/irs-pdf/fw4.pdf

  • I developed a nice little app that helps you use Google docs just like you'd use a regular office suite.
    If you're interested, have a look at http://www.gdocsopen.com

    Hope this helps someone!
  • peptopinkboots
    Very useful. Thank you!
  • jbasdf
    Ya, Google changed their api. This was a cool hack while it lasted. I think there is still a way to do it but you have to write quite a bit more code and work with their api.
  • Michael
    hey this doesn't work anymore, it is my educated guess that google has changed the HTTP request for this function from GET to POST so url parameters won't work...

    just to let you know
  • ita very good facility
  • Google shut down this hack so now you have to use their apis which sucks because instead of five minutes to create a link you have to spend two days integrating their api calls and the user experience stinks (they have to login to Google and are required to follow several more steps).

    It was nice when it worked. Wish Google would be more open.
  • nikki
    Hi, I just tried this and it didn't work - just sent me right to my docs homepage. Perhaps they've changed the google url? Any other suggestions?
  • I've been experimenting with this a bit and it would appear that Google has recently added some security that prevents you from opening a document directly via the url. Not sure why they would do this but personally I have started to find that Google doesn't really like mashups or useful integrations. They provide APIs but I tend to find them far more complicated than they need to be (why should everything need to be a large atom based document you submit via a post) and far less useful than most. The url hack was an awesome way to make it easy for a user to add a link that let other users import a document into Google docs. Big failure here Google.
  • tom
    I am looking for a way to open a "google document" via a URL on a web page (or other allowed locations for such a link) - and I think you are saying you figured out how to do that but the link you provided was truncated. Could you reply to my email tom@gafyd.net and tell me if you know how to achieve what I'm seeking to do..... Thanks Much TOM
  • You're the one to do it, Justin!
blog comments powered by Disqus