Programmatically deleting a filefield content and the associated file? If I do the usual

unset($node-&gt;myfilefield["und"][0]);


Would that take care of the actual deletion of the file as well on node_save?
No, it doesn't. You should use file_delete(). The function will remove the attached file from the database and from the disk.

// Load the node.
$node = node_load('1');
// Get the language for the file field.
$lang = field_language('node', $node, 'myfilefield');
// load the file
$file = file_load($node-&gt;myfilefield[$lang][0]['fid']);
// unset the field for the node
unset($node-&gt;myfilefield[$lang][0]);
// delete file from disk and from database
file_delete($file);
// Save the node.
node_save($node);


The file_delete() also takes a second argument $force that if set to TRUE will remove the file even if it's reported as in use by the file_usage table.