1.20.x file.module file_download_uri($file)

Return an URI for a file download.

File

modules/file/file.module, line 2039
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_download_uri($file) {
  $uri = array('path' => "file/{$file->fid}/download", 'options' => array());
  $uri['options']['query']['token'] = file_get_download_token($file);
  return $uri;
}