How to Add a Google Drive File to OSDownloads

How to Add a Google Drive File to OSDownloads

A few of our customers asked how to set OSDownloads for a remote files repository with Google Drive.

With the Google Drive free file storage, you get fairly generous disk space. Letting your Joomla site visitors download files hosted with your Google Drive account will also save you bandwidth. 

In this tutorial, you will learn how to configure OSDownloads Free to offer to your Joomla site visitors a downloadable file hosted with Google Drive.

This is a five-step process:

  1. Upload the required file to your Google Drive account.
  2. Get your Google Drive file's ID.
  3. Create an OSDownloads file with this ID. 
  4. Create the file's front end menu item.
  5. Test the file download.

In the first step, you upload the required file to your Google Drive account. This is where your OSDownloads will be fetching it from to your site visitors for downloading.

Once the file has been uploaded, you need to copy its ID number. You will use it to tell your OSDownloads where to fetch the file from.

In the third step, you create an OSDownloads file with the file ID number you just copied at Google Drive. This is a placeholder file. It will present your Google Drive file for downloading to your Joomla site visitors.

Once you created an OSDownloads file for the file stored at your Google Drive, you need to make it published at your Joomla site front end. You achieve this by creating a front end menu item.

In the last step, you visit your Joomla site front end and test the file downloading.

Let's take a look at this process in more detail. 


Step #1. Upload the required file to Google Drive.

  • Log into your Google Drive account. In the top left corner of the page, click New:

click new

  • In the drop-down menu, click File Upload:

click file upload

  • Upload the required file from your hard drive to your Google Drive. For my tutorial, I've uploaded a PDF file of our bestselling book "Joomla 3 Explained".

joomla 3 explained uploaded

Excellent. At your Google Drive, you now have a file to offer for downloads via your Joomla site.

Next, you will create a URL link to this file. You will need this link for your OSDownloads component in Step #3 in a minute.


Step #2. Get the file's ID number

  • After the file upload is over, click on the name of the file:

click on the file name

  • You will see the file opened for reading. In the top right corner, click the More actions button:

click more actions

  • In the opened up menu, click Share:

click share

  • You should now see the Share with others box. Click Get shareable link:

click get shareable link

  • You should see the URL resembling https://drive.google.com/file/d/18S59YGNyHomy0TXrwGyIqgsrQfowzE5K/view?usp=sharing Copy the file ID between the /d and /view?. In my example URL, you would need to copy 14S59YJNyHumy0MXrwGyIqgsrQfowzE5R:

copy the part

  • In a text editor of your choice, create a new URL with the following steps:
    • Copy in the editor the following URL: https://drive.google.com/uc?export=download&id=<FILE_ID>.
    • Replace the <FILE_ID> part with the part you ust copied from the file's URL created by your Google Drive. Using my example, your new file URL should look like https://drive.google.com/uc?export=download&id=14S59YJNyHumy0MXrwGyIqgsrQfowzE5R.

Good job! You just created your downloadable file URL. Now let's set your OSDownloads to use this URL and offer this file for downloads on your Joomla site.


Step #3. Create an OSDownloads file with the URL

  • In your Joomla control panel, go to OSDownloads > Files:

go to osdownloads free files

  • You will be taken to the OSDownloads Free: Files administrative page. Click New:

click new

  1. You will see the OSDownloads Free: New File screen. Enter your file name into the Name field. For the purpose of this tutorial, I entered Joomla 3 Explained.
  2. Locate the File Type parameter and click Upload.
  3. Click URL:

enter the url in the file url field

  • You will see the File URL field. Paste in it the link you copied in the previous step:

paste file url in this field

  • Optionally, enter your file description into the Description text area.
  • In the group of setting to the right, make sure you set the Status parameter to Published:

make sure the status is set to published

  • Click Save & Close.

Excellent! At this point, your file is ready at your GoogleDrive. Your Joomla and OSDownloads are ready to offer this file to your site visitors for download. 

Now is a good time to make the file seen by them at the front end of your Joomla site. 


Step #4. Create the OSDownloads file's front end menu item

  • In your Joomla control panel, go to Menus > <Your Required Menu> > Add New Menu Item:

add new menu item

  • Enter your menu item title into the Menu Title field. For my tutorial, I entered Download Joomla 3 Explained.
  • Click Select.

enter the title click select

You will see the Menu Item Type modal box.

  1. Click OSDownloads Free.
  2. Click Single File:

click single file

  • In the menu item File field select the OSDownloads file you created in Step #3:

create front end menu item

  • Click Save & Close.

Step #5. Test your OSDownloads/Google Drive integration at work

  • Visit your site front end.
  • Click on the downloadable file's new menu item.
  • Click on the Download button:

final result

You will be prompted to download the file onto your hard drive. Congratulations! You now know how to add a Google Drive file in OSDownloads to make it downloadable to your Joomla site visitors.


Additional Reading


What's Next

Save $1,000's when you sign up to Joomlashack's Everything Club.

You will get access to all our 32 extensions, and legendary support!

  Click here to join the Everything Club