You are here

function file_entity_download_uri in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.module \file_entity_download_uri()

Return an URI for a file download.

3 calls to file_entity_download_uri()
file_entity_tokens in ./file_entity.tokens.inc
Provide replacement values for placeholder tokens.
theme_file_entity_download_link in ./file_entity.theme.inc
Copy of theme_file_link() for linking to the file download URL.
views_handler_field_file_link_download::render_link in views/views_handler_field_file_link_download.inc
Renders the link.

File

./file_entity.module, line 2599
Extends Drupal file entities to be fieldable and viewable.

Code

function file_entity_download_uri($file) {
  $uri = array(
    'path' => "file/{$file->fid}/download",
    'options' => array(),
  );
  if (!variable_get('file_entity_allow_insecure_download', FALSE)) {
    $uri['options']['query']['token'] = file_entity_get_download_token($file);
  }
  return $uri;
}