ProductDownload

Extends Object. Represents a download associated with a product.

Properties
description

Type String

The description for the download.

id

Type Number

The System ID for the download.

title

Type String

The title for the download.

url

Type Url

The Url of the downloadable file.

visibility

Type 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()

Returns Boolean

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

extension()

Returns String

Gets the file extension for the download.

filename()

Returns String

Gets the file name of the download including its extension.

size()

Returns String

Gets a human readable file size.