Composr Tutorial: Advanced provision of downloads

Written by Chris Graham (ocProducts)
This tutorial details advanced usage and features for the Composr download system.


Getting the downloads onto the site

Image

Attaching a file to a download, and charging for it

Attaching a file to a download, and charging for it

(Click to enlarge)

Composr provides multiple ways to get files into the download system, each appropriate for a different situation.

Uploading via web-form

The easiest way to add a file for a download is by attaching the file to the web-form, when the details of the download are defined. This is the most popular way, and is usually appropriate, however there are some major drawbacks (that are a result of the method, and not the fault of Composr):
  • Users with unreliable connections will not be able to resume the upload if it fails, and sometimes, it is hard to see if the upload has failed, or is just being slow
  • As far as we know none of the common web browsers show a progress monitor for the upload
  • PHP server settings often severely limit the maximum file size that may be uploaded

Uploading, and then referencing the URL

If a file is too large to comfortably upload by web-form, users with FTP or SFTP/SCP access to the server may wish to upload it using this, and then provide the 'Add download' form with an equivalent HTTP URL (or the direct FTP URL) to the location they upload to.
The drawbacks with this method are:
  • It is less convenient than attaching directly
  • FTP/SFTP/SCP access is required and for obvious security reasons, these details are rarely given freely. Note that there is no restriction on actually uploading the file to your website's own server, so people may reference separate web space: but this leaves the download database integrity at the mercy of this secondary web space
  • The file is not contained in Composr, and thus cannot be managed by it (for example, deleted when the download is deleted)

Batch adding from an FTP server

Image

The FTP downloads screen

The FTP downloads screen

(Click to enlarge)

Composr includes a feature that allows staff to batch add files that are on an FTP server, into Composr, by FTP URL. By batch add, we mean adding large numbers of downloads in one go. This is particularly useful for adding large batches of downloads, where immediately making custom download descriptions available is not necessary.
The drawbacks with this method are:
  • Attractive descriptions have to be added separately
  • Only staff may perform this
  • The file is not contained in Composr, and thus cannot be managed by it (for example, deleted when the download is deleted)

Batch adding from a directory

Composr also includes a feature that allows staff to batch add files from a directory on the web server. For this to work, the directory must be accessible by URL.

The drawbacks with this method are:
  • Attractive descriptions have to be added separately
  • Only staff may perform this
  • The file is not contained in Composr, and thus cannot be managed by it (for example, deleted when the download is deleted)

Outmoding

When a download in the download database has a new version released, either as a direct upgrade, or by some other means (such as being bundled into a newer and wider package), the old download may be marked as 'outmoded' by the newer one.

'Outmoded' isn't a word everyone understands. Outmoded means "superseded" or "obsoleted".

To outmode a download, you need to edit the download (the original, older, download) such that the outmode field is set to refer to the newer one. When then viewed, the old download will provide a clear link to the new one.

The older download has now been 'outmoded' by the newer one.

Selling downloads

Image

A download 'for sale'

A download 'for sale'

(Click to enlarge)

The download system is integrated with the points system, which is useful for sites where members publish their own 'works' as downloads.

A common example of a community that would benefit from this, is a community based around the 'modding' of a computer game, where members release 'modifications' for download. Such games include 'Quake', 'The Sims', and many others.
Members may add downloads, and charge for those downloads, using the 'submitter gets points' option. Thus with this, the creators are awarded for their work by the users, using a simple form of currency; this works two ways, much like real world economies do: members are encouraged to become the 'rich members' (as entrepreneurs) as well as to generally earn points (contribute to society).

Another example is a community based upon subscription: points could be bought via a service such as PayPal (Composr at the time of writing provides no specific support for this, but staff could manually allocate points based on PayPal transactions) and the website could require spending of these points to download files.

Moving download galleries

If you don't like that download galleries are placed underneath the root gallery, you can move them under a different gallery. Follow these steps:
  1. Create a new container gallery from Content Management > Galleries > Add Gallery. Let's say you've given it a codename of downloads.
  2. Change the "Create download galleries under" option from Admin Zone > Setup > Configuration > Feature options > Downloads, to downloads
  3. From Commandr, Admin Zone > Tools > Commandr, run this command to mass-move your existing galleries:

Code

:$GLOBALS['SITE_DB']->query('UPDATE '.get_table_prefix().'galleries SET parent_id=\'downloads\' WHERE parent_id=\'root\' AND name LIKE \'download\_%\'');

The advantage to moving them is that then you can essentially forget about them. You can proceed to add images/videos via the direct link from when viewing a download.

Download licences

You may, optionally, add multiple licences to your site, and specify which licence any download uses. This is useful for sites that have copyrighted downloads, or if some kind of agreement must be agreed to before downloading.

Concepts

Outmode
Mark an entry as having been replaced by another one

See also


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.

Back to Top