Downloads with an External File

Introduction

jDownloads supports downloadable files stored on the web on regular web locations and on services such as DropBox, g-drive and similar.

Remember that the Download itself with all the information about type, descriptions, symbols, date, size and so on is still on your site. It is the downloadable file that may be located elsewhere.

Getting the link for an External File to include in a jD Download is not always obvious especially on service providers!  Sometimes there may be unexpected side effects.

The picture opposite shows the 'Files' tab of the front end upload form.  It gives an overview of how to add a file to a Download.

Upload form04
When the file to be downloaded is an External File then jDownloads cannot always determine either the file size or its date.  So you may need to enter that information into the 'File Size' and 'File Date' fields.  For 'internal' files then jDownloads finds the information automatically.

In this article we illustrate setting up a Download with an external file on a regular websitewww2 32px, Drop Boxdropbox icon and g-drivelogo drive 32px.

File located on a web site Server www2 32px

This is the simplest case as all that is necessary is to find the location of the file on the external web site. Note that the file could be on your main web site where the file is not associated with a Download.

The relevant part of the 'Files' section would appear as shown opposite.direct02A
An example would be https://www.some-website/uploads/Website-Brochure-2018.pdf.
You also need to consider the setting of the field "File in External Web site".

In almost all cases this should be set to Yes. This facility controls whether it is downloaded to a separate page or to the same page. The actual way in which the remote server responds does depend however on the type of file extension.
  • setting Yes then a separate page/tab
  • setting No uses same page/tab but for some hosts the server will not respond so change to Yes.
Please remember you may need to add the file date and size manually to the Download itself.
Note: If you set the php option "allow_url_fopen= On" then jDownloads is usually able to determine the file size and date automatically.  This is dependant on the external site in use so it is advised that you do an initial check.

2. File in DropBox dropbox icon

Here is is assumed you have setup a drop box account and have loaded up relevant files.

Getting the file link from DropBox has more steps to go through than for a direct link.
The first step to get the link is to simply right click on the relevant file name in your Drop Box account.

dropbox links03
This will show a Drop Down with a Drop Box section as indicated opposite. So next click on Share as we need to see if the file is shareable.dropbox links04C
The Share type needed is "Can view".

If this is shown then click on 'Copy link' which will copy a link to your Clip Board.

dropbox links05B
If it is not shared then seek advice from Drop box.

The link in the clip board will be something like the one below.

https://www.dropbox.com/s/boqqqqqqqjyh/IMP60%20details.pdf?dl=0   Note that for security the link shown is not a valid link.

Actually there are four forms that the link might be set to be used as an external link as shown in the table opposite.  One style, noted below as 'Special', involves replacing the part www.dropbox in the link with dl.dropboxusercontent
dropbox links01

The other three have different endings a) ?dl=0  b) ?dl=1  c) ?raw=1

Note that the last three possibilities shown in the image above will result in a non standard extension name.

Please also remember to set the file date and size manually in the Download.

3. Google Drive logo drive 32px

Setting up an External link for a g-drive file is similar to that for Dropbox.
Go to your g-drive which is typically a link such as https://drive.google.com/drive/my-drive, then locate the file in g-drive and Right click on the file name.google drive00
As with Dropbox the File must be set as shareable.

That is it must have attribute 'Anyone with the link can view'. 

If it is not shareable then consult Google Drive on how to make it shareable.

Click on  'Copy link' which will put the link in your Clip Board.
google drive02

Note that the link ends with "/view?usp=sharing".

This time the link can be copied in directly into the 'External Link' field as no changes are required.

google drive03
Ensure you have set the field "Is the main file on an external web page?" to Yes.

Also please remember to add the file date and size manually.

External File example - Synology Drive

One of the most popular 'home' based NAS drive units are those in the Synology suite.  So as a practical example of using an external file Download this section describes one of the many ways of using a Synology drive as an external downloadable file location.

Create an account

The first step is to set up a Synology account. (I found this is the most 'awkward part of the entire process!!).
Log in to your Synology Drive as usual and click on the Main Menu button main menu button.  Then select the Control Panel Control Panel Button When the Control panel appears select Info Centre InfoCentre button.  A new panel will be shown that will have a Synology Account tab Synology account button.  This gives access to creating and managing your Synology account.   It seems to take quite a while to create the account and have it recognised so you might need to exit the system and come back several minutes later!

Enable gofile.me links

Once again select the Main Menu main menu button   and select the Control Panel Control Panel Button.  Next select  Quick Connect Quick Conect Button2.  You should now see details of your  Synology account with a Quick Conect ID and details of links. Also the Staus should say 'Connected'.

quick connect01
The format of the Disc Storage Manager (DSM) link is  "https://QuickConnect.to/qwerty"  where qwerty is the Quick Connect ID (this one is a dummy!!).

Adding Shareable Files

For Practical Reasons it is suggested that you first make a specific folder for your downloadable files.  So in this example a location /Pdrive/Shared/ is used where Pdrive is one of the top level Folders in the Disk Station.

On the main Synology page select File station button and then  folder Pdrive/Shared.

As show opposite some files to used external downloadable files have been placed in the folder as usual.

Select a file, for example TestUpload.pdf, and right clickon it.  This will give a long drop-down list.  One of these items, typically the last one is the Share button share button.
File station 01
Clicking on the Share button gives the File Path and the Shared Link as ilustrated opposite'.

The link we need is to insert into the external file option is the combination oo the Shared Link and the Flie Path:
.
https://gofile.me/XXXXXkcAd/Pdrive/Shared/TestUpload.pdf
File station 04

Downloading

Add the complete link into the 'External File Link'.

And set the @Is the main file on an external web page' to Yes.
extern file01
After clicking on the Download Button or similar you will see a message such as the one opposite.

extern file03
Clicking on the download button button again, then some Synology activity will be shown in a new page.

This will then show a new Download page as illustrated opposite.  Clicking on the new Download button will initiate the downloading sequence of the required file.

extern file04
Note that jDownloads has no access to the file itself. So you need to add items like filesize, file pic and similar manually when creating the Download.

ColinM January 2020, updated July 2021

Tags: index

Print Email