Skip to main content
clarification; code can't simply be copied and pasted, but must be customized with your own file field first
Source Link

I also battled with this; this is my solution:

Use the Automatic Nodetitles Module as described by the others, and in the Pattern for the title text box load up the filefield and extract the filename that way. Example:

<?php
//Load the file
$file = file_load($node->field_document['und'][0]['fid']);

// Filename
return $file->filename;
?>

Obviously you need to check the Evaluate PHP in pattern. checkbox at the bottom for this to work, and replace "field_document" with the name of your own file field.

Hope this helps somebody!

I also battled with this; this is my solution:

Use the Automatic Nodetitles Module as described by the others, and in the Pattern for the title text box load up the filefield and extract the filename that way. Example:

<?php
//Load the file
$file = file_load($node->field_document['und'][0]['fid']);

// Filename
return $file->filename;
?>

Obviously you need to check the Evaluate PHP in pattern. checkbox at the bottom for this to work.

Hope this helps somebody!

I also battled with this; this is my solution:

Use the Automatic Nodetitles Module as described by the others, and in the Pattern for the title text box load up the filefield and extract the filename that way. Example:

<?php
//Load the file
$file = file_load($node->field_document['und'][0]['fid']);

// Filename
return $file->filename;
?>

Obviously you need to check the Evaluate PHP in pattern. checkbox at the bottom for this to work, and replace "field_document" with the name of your own file field.

Hope this helps somebody!

Source Link
Hank
  • 121
  • 3

I also battled with this; this is my solution:

Use the Automatic Nodetitles Module as described by the others, and in the Pattern for the title text box load up the filefield and extract the filename that way. Example:

<?php
//Load the file
$file = file_load($node->field_document['und'][0]['fid']);

// Filename
return $file->filename;
?>

Obviously you need to check the Evaluate PHP in pattern. checkbox at the bottom for this to work.

Hope this helps somebody!