How To Upload Files From A WordPress Form To Google Drive

SkyStra
May 15, 2021

Typically, when you upload files using WordPress contact forms – they are stored directly on your WordPress website. But what if you need to share them with your team that doesn’t have admin access to your WordPress Dashboard? This is where a remote storage service comes in. 

If you upload files to Google Drive – it’s easier to share them, and it’s a better way of safekeeping. Google Drive allows you to quickly access your files from any device without the need to log in to your WordPress website, which is another perk. Additionally, you save the disk space on your website, which can be quickly filled with files from your contact forms.

This is especially helpful if you’re taking job applications or hosting a contest. You want PDF resumes and/or photos and videos uploaded to a centralized location so your team can review them.

This article will use the WPForms premium plugin, which has the functionality to automate uploading files from WordPress forms to Google Drive. WPForms is a powerful contact form plugin for WordPress that lets you use a simple drag & drop interface to create forms easily inside of WordPress. 

We’ll also use a third-party tool – Zapier, to connect the WordPress website with the Google Drive service. Zapier is a bridge that lets you send data between two apps, and it currently integrates with over 2000 apps.

Please note that you’ll need at least a Pro version of WPForms in order to use the Zapier integration. 

Prepare A Form On Your Website

Install And Activate WPForms

First, go ahead and purchase the Pro version of the WPForms plugin. Access your account dashboard and download the plugin’s ZIP file.

Log in to your WordPress Dashboard > Plugins > Add New and click Upload Plugin at the top of the page. Click Browse and find the ZIP file on your computer, then click Install Now:

Once installed, click Activate to activate the plugin:

Create A File Upload Form

Next, we need to create a file upload form, which is very straightforward using WPForms.

  1. Head to WPForms > Addons page, find Form Templates Pack Addon and click Install Addon to install it.
  2. Go to WPForms > Add New, and fill in the name of your new form. Find the File Upload Template in the Additional Templates section and click to use it.
  3. Go ahead and customize the form using the drag & drop builder. If you need to restrict or expand the types of files that can be uploaded using the upload form (images, documents, audio, video, etc.), click the File Upload field, then find the Allowed File Extensions box.
  4. In the same section, we recommend checking the Required box to make sure people can’t submit the form without attaching the file to it.
  5. Once you’re finished configuring the new form, click the Save button at the top of the page to save changes.

Add The Form To Your Website

  1. Create a new post or a page, or edit an existing one, and click the + button in the Gutenberg editor content area to add a new block. 
  2. Use the search field to find the WPForms block and click it to add it to the content area. 
  3. Once the WPForms block is added to the page, click the drop-down menu, and choose your file upload form. Adjust the other page options and click Publish to save it once ready.

Test your form and ensure it works properly.

Install And Set Up The Zapier Addon

Next, we need to set up Zapier to use it as a bridge between WordPress and Google Drive.

Head to WPForms > Addons, find the Zapier addon, then click Install Addon.

Next, go to WPForms > Settings > Integrations page, and click the Zapier logo to receive the Zapier API key.

Keep this browser tab open or copy the API key somewhere handy, as we’ll need to use it later in this article.

Create A Zap On Zapier

Now that we have everything set up on our WordPress website, we need to create a Zap to send files from the website to Google Drive directly. Zap is essentially a process with a trigger and an action. 

Here are the steps:

1. Head to the Zapier website and log in to an existing account or create a new free account.

2. Once in Zapier’s Dashboard, click the Make a Zap button.

3. Fill in the name for your new Zap at the top of the page. In the Choose App & Event box, type WPForms and click it. The Choose Trigger Event drop-down box will default to New Form Entry, so just click the Continue button.

4. Next, click the Sign in to WPForms button. A new pop-up window will open, and you need to paste your previously copied API key in the available field. Also, fill in your full website name (https://yourwebsite.com, for example). Once ready, click Yes, Continue to proceed further.

5. Now Zapier will ask you to select your upload form from the list. Find your file upload form and click on it to select it.

6. Once selected, click the Test trigger button to test your form and ensure that Zapier can access it properly. If working correctly – you should see a message that Zapier could find the test entry and see the test data on your screen. Click Continue to proceed further.

7. The next step is to choose our second app, Google Drive. Under the Choose App & Event section, use the search field to find Google Drive and click on it.

8. Under Choose Action Event drop-down menu, find and select the Upload File option.

9. Click the Sign in to Google Drive button and sign in to your Google account. Click Continue once completed.

10. Now we need to select where exactly we want our files to be uploaded in Google Drive. Click the Drive drop-down menu to select personal or shared Google Drive, then click Folder and select the folder you want to use.

11. Finally, under the File drop-down menu, find and select the upload field on your form to tell Zapier which files to upload.

12. Leave all other options as is and click Continue to proceed further.

13. Zapier will now perform a test by uploading the file to Google Drive. Click the Test & Continue button, then check your Google Drive to see if Zapier correctly uploaded the file from your test submission.

14. If everything went well and the feature is working properly – click Turn On Zap to publish it live.

That’s it! From now on, all files sent to your contact form will automatically upload to your Google Drive account. WPForms also keeps a copy of each uploaded file on your website as well in case of any outages with Google Drive or Zapier.