ocPortal Tutorial: Providing downloads
Written by Chris Graham, ocProducts
A system for the storage, organisation and retrieval of files is provided by the software. A file in this system is called a download (and by the way, we don't use the noun 'download' to refer to other things in this software).Note that the download system is not intended for placing articles: there is a dedicated news/articles system for this. You may of course use it to store articles if you prefer to, or to place articles in special formats such as PDF.
Table of contents
Setting up categories
|
Adding a download category |
|
The download tree after adding our category |
This tree principle applies to many areas of ocPortal: we strive to standardise things across our product to make things as consistent (hence, easy) as possible.
Download categories may have 'representative images'. When you are viewing a link to a category from it's parent category, the representative image will be included.
Adding a download
|
Adding a download |
|
Do-next options are provided after adding a download, as is also the case when managing other ocPortal content |
We recommend that you attach a file, as ocPortal can then manage it without risk of the URL being broken by something outside of the ocPortal control. There is a caveat with this, however, as the web was not designed for uploading large files. Essentially, the web was designed to make fast requests for web pages: attaching a large file extends the request, and widens the window for transfer errors (HTTP uploads have no 'resume' mechanism, and no good way of easily finding it a transfer is actually proceeding other than checking for network usage). In addition, PHP may not support large files (sometimes dropping POST information as well as the file, which makes ocPortal give an error message). Therefore we recommend not to try attaching a file more than around 50MB in size. Larger files should be uploaded manually, and then the URL entered.
|
The subcategory (where our download is being stored) is displayed |
|
Our download, listed in its category |
Important note
It is your responsibility to scan files for viruses, as ocPortal does not include a virus scanner. This is particularly relevant to those submitted for validation by users.
|
Viewing a download |
Editing/Deleting a download
|
Editing a download |
|
Deletion options are presented on the edit screen, as is the standard in ocPortal |
When deleting a download you get the option to leave the actual file on the server. This is something you will rarely want to do, as it is best to just let ocPortal manage the files inside your upload directories; however it is useful in the rare case that you added a second download to use the URL of the download about to be deleted.
ocPortal will never try to delete a file that is not inside an upload directory, and naturally it cannot delete the file at any arbitrary URL or any file for which there aren't sufficient file permissions.
Accessing downloads
Downloads are accessed from the 'downloads' module, which is linked to on the default menus on the website ('Downloads', under the 'Content' menu).This link will take the user to the Home download category, from which they can browse through the categories until they find a download they want.
We understand how important it is for users to be able to navigate fast around a website, so we have also created a 'view the whole download tree' feature that they may use to jump straight to the category of their choosing; this is not linked in by default, but can be placed on menus by browsing for it in the menu editor's entry-point tree. The data for the tree is downloaded in a very compressed format, making it fast to load.
Searching inside downloads
User's may use the unified ocPortal searching system to find downloads that match their interests. i.e. downloads may be searched from the search module, or the search block.In addition, the search module is able to search within the actual downloadable files. The following file types are supported for keyword extraction:
- txt, 1st
- rtf
- xml
- searching text buried within binary formats (e.g. doc, ppt)
- searching for other file types within archive files (zip, tar, gz)



