You are here

function _webform_delete_file in Webform 5.2

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

Delete operation for file components or submissions.

Parameters

$data: An array of information containing the submission result, directly correlating to the webform_submitted_data database schema.

$component: An array of information describing the component, directly correlating to the webform_component database schema.

File

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

Code

function _webform_delete_file($data, $component) {

  // Delete an individual submission file.
  $filedata = unserialize($data['value']['0']);
  if (isset($filedata['filepath']) && is_file($filedata['filepath'])) {
    unlink($filedata['filepath']);
  }
}