Do you want to create a WordPress Google Drive upload form?
With WordPress, it’s possible to back up file uploads from your forms to Google Drive.
In this post, we’ll show you how to add a file upload feature to your contact forms, and also have those files automatically backed up in your Google Drive.
Why Create a Google Drive Upload Form?
A Google Drive upload form gives you the reliability of having your uploads from forms safely stored at all times. Normally, form uploads are stored on your website’s servers. But your website can quickly run out of space if all of your uploads are stored within it.
When you connect Google Drive with your contact form, it will also send a copy of those uploaded files to your Google Drive. That way, you will have copies of those uploaded files on both your server and Google Drive. But you’re going to need a WordPress Google Drive upload plugin to achieve this, as we’ll show below.
Besides, it’s always wise to have a copy of your files in case of scenarios like data corruption or, worse, a hacker attack.
Note: This guide will only show you how to save your upload form file attachments into a Google Drive folder. If you also want to save your contact form entries such as the name, email, and message, check out our guide on learning how to connect a contact form with Google Sheets.
Now that we know why creating a Google Drive upload form is so important, let’s dive into the steps for how you can connect your file uploads with Google Drive.
How to Create a WordPress Google Drive Upload Form
Let’s dive into creating a WordPress Google Drive integration so you can back up from your WordPress forms.
In This Article
1. Install WordPress Google Drive Upload Plugin
WPForms is the best WordPress plugin to upload files to Google Drive. To start uploading files from WordPress to Google Drive, your first need to install the WPForms plugin on your WordPress site if you don’t already have it.
If you don’t know how, see our documentation on installing the WPForms plugin for help.
For this tutorial, you’ll also need the Zapier addon. It lets you connect your forms to thousands of other apps, including Google Drive and Dropbox for file uploads.
Go to WPForms » Addons in your admin area and click Install Addon to install and activate it.
For more detailed instructions, see this tutorial on adding WPForms addons.
After it’s installed and activated on your site, it’s time to create the file upload form in the next step.
2. Create the File Upload Form
Open your WordPress admin area and click on WPForms » Add New.
This will open the WPForms form builder. Here, start by giving your form a suitable name.
Next, we’ll take advantage of WPForms’ extensive library of form templates. To make our job easier, we’ll use the File Upload Form template.
Scroll down and type in File Upload Form in the search field under the Select a Template section. Then, select the template by clicking on Use Template.
When the template opens, you’ll find some common fields within including a file upload field. You can customize this template any way you like or leave it as it is.
For a more detailed guide on file upload forms, see our tutorial on how to create a file upload form in WordPress.
When you’re ready, make sure to Save the form.
3. Embed and Publish the Upload Form
Now, we’re going to add the upload form to a new page on our WordPress site. Click on the Embed button on the top-right of the form builder.
Now, select Create New Page in the dialog box.
Give your new page a name.
Now, you’ll be taken to your new page with the upload form you just created already embedded within. Click on Publish to finish adding this page to your site.
When your form is published, fill out a test entry yourself. This will allow Zapier to test its integration with WPForms in the next step.
4. Connect WPForms With Zapier
In order to connect Google Drive with WPForms, you’ll need a Zapier account (you can get it for free). Once, you’ve set up your account on Zapier, navigate to your dashboard and click on Create Zap.
Now, search for WPForms in the search field and click on WPForms when it appears on your screen.
Next, click on the Trigger Event dropdown field and select New Form Entry.
To proceed, you’ll now need to integrate your WPForms plugin with Zapier. Click on Sign in.
This will open a new window asking for your WPForms API key.
Back in your WordPress admin area, go to WPForms » Settings » Integrations. Now, click on the Zapier icon to access your API key.
Copy the key and switch to Zapier’s WPForms connection window. Then, paste the key under the API Key field. Also, enter your website URL. When you’re done, click on Yes, Continue.
You should now be back to Zapier’s zap creation window. Click on Continue.
Now, we’re going to set up a trigger. Click on the dropdown field to see all the forms that you’ve created with WPForms so far. Make sure to select the right one from the list.
For this example, we want to select the File Upload Form. Press Continue after you’ve made your selection.
Now, we’re going to test your zap. Click on Test trigger.
Zapier should find the test entry that you filled out in the previous step, which will look something like this.
Click on Continue to finish this step. Next, we’re going to connect Zapier to your Google Drive.
5. Connect Google Drive with Zapier
After you’ve pressed the Continue button to finish the previous step, Zapier will ask you to choose an app to connect your WPForms triggers with. Search for Google Drive in the search field and click on the icon.
Zapier will then ask you to sign in to Google. Press the Sign in button.
This will open a popup where you can log in to your Google account.
Then you’ll need to give Zapier permission to access your Google account. Click the Allow button to proceed.
Now, we’ll set up the action we want Google Drive to perform when a new form entry is created on our site. Select your Google Drive to use, the folder where the uploads should be saved, and the file upload field from your form.
You can leave the rest of the options blank. But, you can customize them if you’d like to automatically convert your uploaded files to Google Drive file formats or change the names.
Once you’re done, click Continue.
Zapier is now ready to test your Google Drive action event. Click on Test action to proceed.
You should instantly see a confirmation message stating that your upload file was sent to Google Drive. You can also log in to your Google Drive and confirm if the upload you provided during form entry was correctly sent to your selected folder.
Note: WordPress might also restrict some types of file uploads. You can fix that by following this guide on allowing additional file types.
Make sure to publish your Zap before you leave Zapier.