Download file from field instead of going to node page What I'm trying to achieve is: create a new content of type arquivo, then when accessing the new content url, instead of showing a page with the fields and etc., the file from a field_file is opened/downloaded. Tried to achieve this using a custom template for the content type with no success.
The code for the tpl.php is:

&lt;?php
$items = field_get_items('node', $node, 'field_arquivo');
$filepath = $items[1]['uri'];
$path = file_create_url($filepath);
drupal_goto($path); 
?&gt;


Any help is appreciated
You could make a custom module and put this function in it

/**
 * Implements hook_node_view().
 */
function custom_tweaks_node_view($node, $view_mode, $langcode) {
  if ($node-&gt;type == 'arquivo' &amp;&amp; $view_mode == 'full') {
    $file = $node-&gt;field_file[$langcode][0]['uri'];
    if ($file) {
      $file_uri = file_create_url($file);
      drupal_goto($file_uri);
    }
  }
}