function _webform_submit_file in Webform 7.4
Same name and namespace in other branches
- 5.2 components/file.inc \_webform_submit_file()
- 5 components/file.inc \_webform_submit_file()
- 6.3 components/file.inc \_webform_submit_file()
- 6.2 components/file.inc \_webform_submit_file()
- 7.3 components/file.inc \_webform_submit_file()
Implements _webform_submit_component().
File
- components/
file.inc, line 414 - Webform module file component.
Code
function _webform_submit_file($component, $value) {
$fid = is_array($value) ? !empty($value['fid']) ? $value['fid'] : '' : (!empty($value) ? $value : '');
// Extend access to this file, even if the submission has not been saved yet.
// This may happen when previewing a private file which was selected but not
// explicitly uploaded, and then previewed.
if ($fid) {
$_SESSION['webform_files'][$fid] = $fid;
}
return $fid;
}