You are here

function _filefield_file_delete in FileField 5

Same name and namespace in other branches
  1. 5.2 filefield.module \_filefield_file_delete()
2 calls to _filefield_file_delete()
filefield_field in ./filefield.module
Implementation of hook_field().
filefield_file_update in ./filefield.module
update the file record if necessary

File

./filefield.module, line 248
Defines a file field type.

Code

function _filefield_file_delete($file, $fieldname) {
  if (is_numeric($file['fid'])) {
    db_query('DELETE FROM {files} WHERE fid = %d', $file['fid']);
  }
  else {
    unset($_SESSION['filefield'][$fieldname][$file['sessionid']]);
  }
  return file_delete($file['filepath']);
}