hPreFileDownload

This hook allows plugins to observe file downloads.

If the plugin sets the redirectPath response property, the file download will not be audited.

Arguments

Name Type Description
file File The file being downloaded
transform String A string specifying the requested transform, or the empty string if none requested.

Response

Return information by changing these properties of the response object.

Name Type Description
redirectPath String If set, the user will be redirected to this path instead of downloading the file

JavaScript template


P.hook('hPreFileDownload', function(response, file, transform) {
    // Respond to hook, for example
    // response.redirectPath = ...
});