1 file.module file_download_uri($file)

Return an URI for a file download.

File

core/modules/file/file.module, line 2054
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;
}