ProductDownload

Extends Object. Represents a download associated with a product.

Properties
description String

The description for the download.

id Number

The System ID for the download.

title String

The title for the download.

url Url

The Url of the downloadable file.

visibility String

The visibility option for the download, which will be one of the following options:

  • public - unprotected, available to all visitors
  • contact - login protected, available to all registered users. File must also be stored within the private media folder.
  • purchase - protected, requires purchase. File must also be stored within the private media folder.

Note that downloads with contact and purchase privileges will only be returned if applicable to the current user.



Methods
exists() Boolean

True if the file exists, else false if it is missing.

extension() String

Gets the file extension for the download.

filename() String

Gets the file name of the download including its extension.

size() String

Gets a human readable file size.