You are here

function _webform_delete_file in Webform 6.3

Same name and namespace in other branches
  1. 5.2 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()

Implements _webform_delete_component().

File

components/file.inc, line 514
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]))) {
    unlink($file->filepath);
    db_query("DELETE FROM {files} WHERE fid = '%d'", $file->fid);
  }
}