Save Any File to Google Drive

I have been working on doing this for quite some time within AppInventor, but the tools required on board are just not quite there to do it yet. However, I have come up with a “slingshot” solution using a combination of web technologies that will get a file from your device up to google drive.

In order to achieve this, you will require the following:

  1. A google web app
  2. An https web server with php and ftp access
  3. A couple of php scripts / pages
  4. Ai2 developed app

Credits to Scott Ferguson for the postfile howto, Digital Inspiration for the bones of the apps script, and to Taifun for the File extension 🙂

Again I assume that you have a good grip of AI2, writing and publishing google app script web apps, and the ability to ftp to your web space on an https server (Google Drive will NOT accept urls from non https servers)

Continue reading “Save Any File to Google Drive”

OCR Images (with text) using Google Drive and Google Apps Script

This works remarkably well, both for images on file and those taken with the device’s camera. A shot of a somewhat crumpled petrol receipt returned all the text on the original.

You are going to have to do some layout and formatting with the returned text, but very little word editing.

For this I used two google apps script web apps, one for the image upload to google drive, the second to carry out the OCR. I attempted to combine them into one, but couldn’t get my “blob” to play nicely. Google Docs will OCR jpg, png, gif and pdf files, but sadly no pdf functionality in this version, yet to resolve base64 encoding of pdf files on AI2, this only seems viable with images at present.

I used two extensions, ghostfox’s base64 Encoder extension, and
Taifun’s Image extension. And a nod also to Digital Inspiration and Tanaike for some of the code. Gratitudes to all of you 🙂

Once again assuming you are reasonably competent with AI2 and google apps scripting…. Continue reading “OCR Images (with text) using Google Drive and Google Apps Script”