Skip to main content

generate_download_hash()

public static function generate_download_hash( $form_id, $field_id, $file, $entry_id=0 )

Generates a hash for a Gravity Forms download.

May return false if the algorithm is not available.

Since:

  • 2.0
  • 2.9.29 (Added the $entry_id param.)

Source: common.php:7406

Parameters

NameTypeDefaultDescription
$form_idintThe Form ID.
$field_idintThe ID of the field used to upload the file.
$filestringThe file url relative to the form's upload folder. E.g. 2016/04/my-file.pdf
$entry_idint0The entry ID. Optional.

Returns

  • string | bool