You are here

function webfm_delete_file in Web File Manager 5

Same name and namespace in other branches
  1. 5.2 webfm_file.inc \webfm_delete_file()
1 call to webfm_delete_file()
webfm_delete_dir_recur in ./webfm_file.inc
webfm_delete_dir_recur - called from the ajax action - switch case 'delete':

File

./webfm_file.inc, line 181

Code

function webfm_delete_file($source, &$error) {
  $file = webfm_get_file_record('', $source);
  if (@unlink($source)) {
    if ($file && !webfm_dbdelete_file($file->fid)) {
      $error = t('webfm_dbdelete_file() fail for ') . $source;
      return FALSE;
    }
  }
  else {
    if (file_exists($source)) {
      $error = $source . t(' could not be deleted');
      return FALSE;
    }
  }
  return TRUE;
}