How to place size of file in the node in the title? I want create page for issues of newspaper. Title of the issue page must contain the issue number, date of publishing and size of newspaper file in MB.

I implemented number and date in title with Automatic Entity Labels and Token modules. But how I can place in title size of the uploaded file?

I tried to use custom module:

/**
* Implements hook_token_info().
*/
function mytokens_token_info() {
$node_tokens['field_file']['size'] = array(
  'name' =&gt; t('File size'),
  'description' =&gt; t('File size'),
);
$node_tokens['field_file']['size']['mbytes'] = array(
  'name' =&gt; t('In MB'),
  'description' =&gt; t('File size in MB'),
);
return array(
  'tokens' =&gt; array(
  'node' =&gt; $node_tokens,
  ),
);
}

/**
 * Implements hook_tokens().
 */
function mytokens_tokens($type, $tokens, array $data = array(), array $options = array()) {
$replacements = array();

if ($type == 'node' &amp;&amp; !empty($data['node'])) {
$node = $data['node'];

foreach ($tokens as $name =&gt; $original) {
  if ($name == 'mbytes') {
    $replacements[$original] = $node-&gt;field_file['und'][0]['filesize']/(1024*1024);
  }
}
}

  return $replacements;
}


But my tokens don't shows in the token tree and nothing replacements occur.
Install Token and you can use [file:size] in your title to fetch file size. Here is the list of all file tokens you can choose from.