fileupload_validate(&$node)
contributions/docs/developer/examples/fileupload.module, line 162
Implementation of hook_validate().
Verify that there is a file attached to the node.
function fileupload_validate(&$node) {
// Check for a new file upload.
if ($file = file_check_upload('file')) {
$node->file = $file;
}
// Make sure there is an upload or an existing file.
if (!$file && !file_exists($node->current_file)) {
form_set_error('file', t('A file must be provided.'));
}
}