You are here

function webform_file_url in Webform 6.2

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

Helper function to create proper URLs for uploaded file.

4 calls to webform_file_url()
theme_webform_mail_file in components/file.inc
Format the output of emailed data for this component
_webform_csv_data_file in components/file.inc
Return the result of a file submission. The output of this function will be displayed under the "results" tab then "submissions".
_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 582
Webform module file component.

Code

function webform_file_url($filepath) {
  if (!empty($filepath)) {
    $info = pathinfo($filepath);
    $file_url = file_create_url($info['dirname'] . '/' . rawurlencode($info['basename']));
  }
  return isset($file_url) ? $file_url : '';
}