You are here

function comment_upload_delete_file in Comment Upload 6

Delete a file and its associated records.

Parameters

array $file:

3 calls to comment_upload_delete_file()
comment_upload_comment_delete in ./comment_upload.module
Remove files when the comment is deleted.
comment_upload_nodeapi in ./comment_upload.module
comment_upload_save in ./comment_upload.module
Save the changes made to attachments.

File

./comment_upload.module, line 626
Provides file attachment functionality for comments.

Code

function comment_upload_delete_file($file) {
  file_delete($file['filepath']);
  db_query('DELETE FROM {files} WHERE fid = %d', $file['fid']);
  db_query("DELETE FROM {comment_upload} WHERE fid = %d", $file['fid']);
}