You are here

function _file_resource_delete in Services 7.3

Same name and namespace in other branches
  1. 6.3 resources/file_resource.inc \_file_resource_delete()

Delete a file.

Parameters

$fid: Unique identifier of the file to delete.

Return value

bool Whether or not the delete was successful.

1 string reference to '_file_resource_delete'
_file_resource_definition in resources/file_resource.inc
THERE SHOULD BE NO UPDATE!!! Drupal doesn't allow updating or replacing a file in the files table. If you need to, create a new file and remove the old file.

File

resources/file_resource.inc, line 311
File resource.

Code

function _file_resource_delete($fid) {
  if ($file = file_load($fid)) {
    file_usage_delete($file, 'services');
    return file_delete($file);
  }
  return FALSE;
}