You are here

function _webform_delete_file in Webform 7.3

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

Implements _webform_delete_component().

1 call to _webform_delete_file()
webform_update_7321 in ./webform.install
Remove files left over from deleted submissions. Such files are now deleted automatically.

File

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

Code

function _webform_delete_file($component, $value) {

  // Delete an individual submission file.
  if (!empty($value[0]) && ($file = webform_get_file($value[0]))) {
    file_usage_delete($file, 'webform');
    file_delete($file);
  }
}