function _filefield_file_delete in FileField 5.2
Same name and namespace in other branches
- 5 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 360 - Defines a file field type.
Code
function _filefield_file_delete($node, $field, $file) {
if (is_numeric($file['fid'])) {
db_query('DELETE FROM {files} WHERE fid = %d', $file['fid']);
}
else {
unset($_SESSION['filefield'][$field['field_name']][$file['sessionid']]);
}
module_invoke_all('filefield', 'file_delete', $node, $field, $file);
return file_delete($file['filepath']);
}