Automatically upload files from a form’s File Upload field to Google Drive. Google Drive requires Contactum Pro with the Google Drive module enabled.
Requirements #
- Contactum Pro, with the Google Drive module active (Contactum → Modules)
- A Google Cloud project with an OAuth 2.0 Client ID (Web application)
- Your OAuth Client’s Client ID and Client Secret
1. Create a Google OAuth Client #
- In Google Cloud Console → APIs & Services → Credentials, create an OAuth 2.0 Client ID of type Web application.
- Copy the Client ID and Client Secret.
- Add the exact Authorized redirect URI Contactum shows you (see step 2 below) to the OAuth Client’s allowed redirect URIs.
2. Connect Google Drive in Contactum #
- Go to Contactum → Settings → Integrations → Google Drive.
- Paste in your Client ID and Client Secret.
- Copy the Authorized redirect URI shown on the page (
{your-site}/wp-admin/?contactum_google_drive_auth=1) into your OAuth Client, if you haven’t already. - Click Connect Google Drive.
You’re sent to Google to sign in and grant access. Google will always show the permission screen (even if you’ve connected before), which guarantees Contactum receives a fresh refresh token. After approving, you’re returned to Contactum and the status turns green.
To disconnect, click Disconnect Google Drive — this clears the stored tokens and stops all uploads until reconnected.
3. Enable Google Drive on a Specific Form #
- Open the form in the builder.
- Go to Form Settings → Integrations.
- Toggle Google Drive on, then click Configure.
4. Configure Upload Settings #
| Field | Description |
|---|---|
| Enable Google Drive for this form | Turns Google Drive uploads on for this specific form |
| Folder | Pick a destination folder from the dropdown (click the refresh icon to reload). Leave as the default to upload to the root of My Drive |
| Delete local copy after upload | Removes the file from your WordPress server once it’s safely uploaded to Google Drive |
Unlike Dropbox/OneDrive’s typed folder path, Google Drive gives you an actual folder picker — but with one important limitation, covered below.
5. How It Works #
Uploads happen as soon as a visitor selects a file in a File Upload field, not when the form is finally submitted:
- Contactum checks the form has Google Drive enabled and the global connection is active.
- The file is uploaded to the selected folder (or Drive root if none is chosen), keeping its original filename and MIME type.
- On success, Contactum stores the file’s Google Drive link on its WordPress attachment.
A failed upload does not block form submission, and is recorded in Contactum’s API Log for review.
An important limitation of the Folder picker: for privacy, Contactum only requests access to files it itself creates in your Drive — not your whole Drive. This means the Folder dropdown will only ever show folders that were previously created through this same connected integration. Pre-existing folders you made yourself in Google Drive generally won’t appear in the list. If you don’t see the folder you want, upload once to the Drive root (or a new folder) and organize it afterward directly in Google Drive.
Troubleshooting #
Files aren’t uploading to Google Drive #
- Confirm the form has Google Drive toggled on and was saved.
- Confirm the global connection still shows verified.
- Check the API Log (Contactum → Tools → API Log, if available) for a logged failure and its error message.
My folder doesn’t appear in the dropdown #
- This is expected for folders that weren’t created through this integration — see the limitation above. Upload to root or a newly-created folder instead.
Connecting keeps failing #
- Double-check the Authorized redirect URI registered on your Google OAuth Client matches Contactum’s shown value exactly.
Notes #
- Requires Contactum Pro with the Google Drive module active — not available in the free plugin.
- Auth method: OAuth2 (Google “Sign in” style connect button), scoped to files this app creates only (
drive.filescope) — never your whole Drive. - Credentials storage: OAuth credentials and tokens are stored in
wp_optionsunder the keycontactum_google_drive.