Skip to main content

Dropfiles: Google Drive Integration

1. Create a Google drive App

The Google Drive is included in the main Dropfiles package.

First, you need a Google dev App to connect your website to Google Drive. Go to https://console.cloud.google.com/ and create a new project.

 

Create-project-1

 

Then setup a project name (no space, no accent)

 

new-project-1

 

Then wait few seconds for the project creation…

 

image62

 

If it's the first time you're using the Google Drive API, you should go to Navigation menu > APIs and Services > Library to activate it.

 

enable-drive-api

 

From the left menu, click on “Navigation menu > APIs and Services”

 

credentials-menu-1

 

Then on the left menu “Credentials”, on the main panel click “ + Create Credentials” >> OAuth client ID (if asked, add a name to your OAuth consent screen).

 

create-Credentials-1

 

Now, the most important step.

  • Select “Web application” and add a name of your choice.
  • Authorized JavaScript origin: https://your-domain.com (replace by your domain name, no slash, no www.)
  • Authorized redirect URIs: https://your-domain.com/administrator/index.php?option=com_dropfiles&task=googledrive.authenticate (put your domain name)
This is the backend Dropfiles URL + &task=googledrive.authenticate

 

create-web-application

 

Note: if this warning appears: "Invalid Origin: domain must be added to the authorized domains list before submitting", press authorized domains list link or go to APIs & Services >> OAuth consent screen, then add your domain name at Authorized domains.

 

consent-screen

 

Then… voilà! You got your ID and Secret to add in the Dropfiles configuration.

 

oauth-client-1

 

In order to use "the sync with Google Drive in real time" feature, you need to verify your Domain. You should follow these steps below:

Please go to “APIs & Services” >> "Domain verification", click on Add domain button. Next, input your domain and click on Add domain button.

 

add-domain

 

If your domain was verified, then you add domain successfully. Go to Dropfiles configuration for the next step.

 

add-verify-domain

 

If your domain has not been verified, a pop-up window will be appeared, click on Take me there button.

 

take-me-there

 

You will be linked to "Webmaster Central" page. From here, you should:

  • Select your domain name provider, if the list does not include your provider, choose Other
  • Add the TXT record to the DNS configuration. E.g: google-site-verification=vyV1rZfPloPdrFjau0Hw2W9d18_bd...
  • Click on Verify button

 

verify-domain

 

The page with successful notification will be shown if you do correctly the steps above. After that, go to the Dropfiles configuration for the next step.

 

verify-success

 

2. Login to Google Drive in Dropfiles

Automatic mode

From now, you can save a lot of time while connecting to the Google Drive server.  First, in order to use this feature, you have to connect your Joomunited account at Dropfiles Settings > Live Updates tab, please click on the Link My Joomunited Account button and login if you have not connected.

 

live-updates-dropfiles

 

Then go to Cloud connection > Google Drive tab and just click on Connect Google Drive button on the right corner.

 

automatic-google-drive-dropfiles

 

Then follow the next steps to finish the connection.

 

auto-google-drive-connected-dropfiles

 

Manual mode

With the credentials in the previous step, please go to Joomla admin and click on the menu Dropfiles > Options > Cloud connection tab > Google Drive settings section. Paste your

  • Client ID
  • Client secret

Then save the configuration and click on the Connect button.

 

google-drive-credential

 

After that, a pop-up window will be shown and you can select your account.

If you haven’t made any mistakes you should select Google account and validate the authorization in a new window like below.

 

confirm-author

 

Connection should be a success ☺ Simultaneously, you will see the parameter "Watch changes from Google Drive" is turned on. If you turn off Files and Folders will not be synchronized immediately from Google Drive to your Dropfiles.

 

watch-changes-from-Google

 

Now, you can create Google Drive folders and upload files in it!

 

new-drive

 

Get rid of the error: error: "invalid_scope when connect Dropfiles with Google Drive"

Google have recently introduced a new security layer that forces apps to be verified.  If you've created the app with your Google account and then you login from Joomla with the very same account you won't see this error.
This error will only appear if you've created an App with a Google account and trying to connect to Google from Joomla with another account.

In this case you need your app to get approved by Google following this process: https://support.google.com/code/contact/oauth_app_verification

 

OAuth-Developer-Verification-Form


3. How it works? What can I do with GG Drive?

How it works? 

Dropfiles will generate a root folder on your Google Drive with the site name

 

google-drive-folder


All the categories and sub categories added in Dropfiles will added under this folder.

 

What are the sync directions?

It works in both directions! You can add a file from Google Drive and see it in Dropfiles or add a file in Dropfiles and see it in Google Drive. It also means you can manage files in Dropfiles from your desktop using Google Drive sync software. That’s crazy! Yes we know ☺

Note that if you remove a file from Google Drive you have to empty your trash to erase it from Google Drive.

 

drive-sync