Blog

Uploading files to Google Drive via Apps Script

3 Flares 3 Flares ×

If your business requires you to survey your customers, you currently have several free web-based options. PollDaddy, SurveyMonkey, and Google (by way of a form hosted on Google Drive) all offer zero cost options to handle simple surveys.

Unfortunately, none of them offer a great option to allow users to upload files as part of their response. Perhaps your customers want to send you photos of your product in action or a PDF of a service ticket. Of the three survey options listed above, only PollDaddy surveys offer a file upload option, though it’s limited to 1MB, a level that’s not quite practical for some applications.

EnterĀ Google Apps Script, a cloud-based platform that leverages JavaScript to interact with Google’s suite of apps. With some fairly simple (relatively speaking, of course) JavaScript, you can now add as many file upload prompts as you’d like. Drive allows you to publish your code as a web app, which you can then share as a link to your customers, staff, or anyone else. You can even select the destination folder on your Drive account where your uploads will be stored. All you have to do is make sure you stay below Drive’s 15GB storage limit.

That’s 15,360 times the capacity you’d get with any free survey option. Enjoy the snippet posted below – it’s also committed to GitHub atĀ https://github.com/drewdepriest/AppScriptUpload.

GAS Form

User interface defined in the doGet() function. Handles checkboxes and file upload.


Form submission page

Page displayed once user submits the form. Script shows contents of all files previously uploaded, including thumbnail, name and timestamp.

3 Flares Twitter 2 Facebook 0 Google+ 0 LinkedIn 1 Email -- 3 Flares ×
Tags: , , , ,

Show Comments (6)

This is a unique website which will require a more modern browser to work! Please upgrade today!

3 Flares Twitter 2 Facebook 0 Google+ 0 LinkedIn 1 Email -- 3 Flares ×