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.
Then setup a project name (no space, no accent)
Then wait few seconds for the project creation…
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.
From the left menu, click on “Navigation menu > APIs and Services”
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).
Now, the most important step.
- Select “Web application” and add a name of your choice.
- Authorized redirect URIs: https://your-domain.com/administrator/index.php?option=com_dropfiles&task=googledrive.authenticate (put your domain name)
Then… voilà! You got your ID and Secret to add in the Dropfiles configuration.
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.
If your domain was verified, then you add domain successfully. Go to Dropfiles configuration for the next step.
If your domain has not been verified, a pop-up window will be appeared, click on Take me there button.
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
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.
2. Login to Google Drive in Dropfiles
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.
Then go to Cloud connection > Google Drive tab and just click on Connect Google Drive button on the right corner.
Then follow the next steps to finish the connection.
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.
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.
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.
Now, you can create Google Drive folders and upload files in it!
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
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
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.