I’ve been writing about how to upload files from Facebook, download files from Instagram, and allow users to upload files from their desktop or mobile device, but a lot of users store their files in an online cloud drive; how do we connect to those? Fortunately, Filestack’s File Picker integrates with third party services like these in a seamless and ridiculously easy-to-implement default set of options. For example, if you want to upload Google Drive files to your site from your users, all you have to worry about is keeping track of which file handles belong to which users on your app. The authentication, authorization, and ingest of the files are all handled auto-magically by Filestack’s picker.
As with the ability to upload user Instagram photos and Facebook photos, the functionality of uploading Google Drive photos is available in the File Picker and turned on by default. When you display the default File Picker, your site users can choose from a variety of ready-to-go integrations. Your users choose the source they wish to use, and if it is a third party source they can click to authorize a connection.
Once a user has authorized the Filestack app to provide access to their desired Drive files, they can view this in their Google Drive settings:
One unique advantage of picking files from Google Drive over, say, Facebook or Instagram, is that different types of files may be selected in addition to images. This can be useful if you implement Filestack’s file conversion API, or wish to display a file in one of the available file viewers. You can also limit the MIME types of the files you wish to allow by passing a simple configuration object in JSON when initializing the File Picker on your page. Keep in mind as you implement your solution that everything about connecting to Google Drive, authorizing, picking files, and uploading is handled for you by Filestack; when that’s all done, you get back a File Handle and it’s your job to decide how your app will handle keeping track of those handles. All in all, this is the easiest way to upload Google Drive user files; so easy, a group of students implemented exactly this in under 5 minutes at a workshop I gave in New Jersey recently. Try it! Let me know what you think.
David Liedle is Filestack’s Chief Evangelist. He works remotely in New York City with his wife and son, and their kitty. See more at https://DavidCanHelp.me/
Read More →