You are here

function webform_file_url in Webform 5.2

Same name and namespace in other branches
  1. 6.3 components/file.inc \webform_file_url()
  2. 6.2 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.

2 calls to webform_file_url()
theme_webform_mail_file in components/file.inc
Format the output of emailed data for this component
_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".

File

components/file.inc, line 558
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 : '';
}