You are here

function webform_file_name in Webform 6.2

Same name and namespace in other branches
  1. 6.3 components/file.inc \webform_file_name()
  2. 7.4 components/file.inc \webform_file_name()
  3. 7.3 components/file.inc \webform_file_name()

Helper function to create proper file names for uploaded file.

2 calls to webform_file_name()
_webform_submission_display_file in components/file.inc
Display the result of a file submission. The output of this function will be displayed under the "results" tab then "submissions".
_webform_table_data_file in components/file.inc
Return the result of this component's submission for display in a table. The output of this function will be displayed under the "results" tab then "table".

File

components/file.inc, line 593
Webform module file component.

Code

function webform_file_name($filepath) {
  if (!empty($filepath)) {
    $info = pathinfo($filepath);
    $file_name = $info['basename'];
  }
  return isset($file_name) ? $file_name : '';
}