You are here

function imce_delete_file in IMCE 6

Same name and namespace in other branches
  1. 5 imce.module \imce_delete_file()
  2. 6.2 inc/imce.page.inc \imce_delete_file()
  3. 7 inc/imce.page.inc \imce_delete_file()

Delete a file in the file list.

1 string reference to 'imce_delete_file'
imce_delete_submit in inc/page.inc
Submit delete form.

File

inc/page.inc, line 380

Code

function imce_delete_file($filename, &$imce) {
  $filepath = file_directory_path() . ($imce['dir'] == '.' ? '' : '/' . $imce['dir']) . '/' . $filename;
  if (!file_delete($filepath)) {
    return FALSE;
  }
  db_query("DELETE FROM {files} WHERE filepath = '%s'", $filepath);
  imce_remove_file($filename, $imce);
  return TRUE;
}