Introduction
In general if a file is 'not chargeable' in say points or other mechanisms then the combination of the first two methods described below plus the Joomla! Access and Permission features are an excellent defence.
In this article two out of the three available protecton method use what is known as an '.htaccess' file. This file is used by the web site to enable control of many aspects, including access protection. It is not necessary to become familiar with the details of an .htaccess file except to understand that if there is an .htaccess file in a directory then the "commands" apply to the files in that directory and to those files in the entire chain of all the following sub directories. So typically an .htaccess file is placed in a root directory.
Also an .htaccess file may be placed in one of the subdirectories to apply further conditions or to modify conditions set in an earlier .htaccess file. But this is not required.
Include index.html file
When a new Category is created by jDownloads then an index.html file is automatically inserted in the directory. The contents of this index.html file are typically: <<html><body bgcolor="#FFFFFF"></body></html> . If executed this causes a white page on the screen!
Disallow "Indexes" using .htaccess file
Most web site hosts have the Indexes option deactivated as the default so visitors can browse to the download folders and see the files.
If Indexes are allowed, and the directory does not have either an index.html or an index.php file, then a browser will show the contents of the directory just like your file manager would do as shown in the example opposite.

Options -Indexes
Note The default Joomla! .htaccess file includes the above option in the root of the site so all directories then have this level of protection.
Go to
This involves renaming 'htaccess.txt' to '.htaccess'
(Note the . before htaccess)
Sometimes the native file system does not carry out the renaming as it expects a 'filename' before the 'extension'.
In such a situation renaming is readily done using an FTP utility such as File Zilla.

System SEF Plugin
Go to
Generally the default settings as shown opposite are OK, although setting 'Enforce a suffix by redirect' is often set to Yes.

Deny Access using .htaccess file
For example if the user knows that a file called test.mp4 is stored on www.mysite.com in directory /dirA/subdirB then by loading www.mysite.com/dirA/subdirB/test.mp4 into a browser then that file can be 'stolen'.
The need to protect files from being 'stolen' is obviously very important for those sites which are effectively 'selling' the file, and also where there may be some degree of confidentiality involved. To prevent this jDownloads is able to add a specific .htaccess file into your jDownloads root folder. This file then only allows php files on the site to access and download the file.
This will copy the special .htaccess to your Downloads root directory as shown in the second image opposite. If the 'Protect Your Download Directory' is set to No then the .htaccess file is removed.


- in
-
tab set 'Send Downloads using the PHP Script' to Yes; - in


-
tab set 'Protect your Download Directory' to Yes; - in

-
tab set 'Activate Hotlinking Protection' to Yes.
Audio and Video Files
Do not use the full media file as browsers allow the file being played to be downloaded!
