How to validate file using hook_file_validate?
In Drupal 7 just use drupal_set_message

/**
 * Implementing hook_file_validate
 * @param type $file : Object
 * @return type : array of error messages
 */
function hook_file_validate($file) {
    drupal_set_message("&lt;pre&gt;" . print_r($file, 1) . "&lt;/pre&gt;");
    $errors = array();
    if ($file-&gt;source == 'field_article_file_und_0') {
        if ($file-&gt;filesize &gt; 290081) {
            $errors[] = t("The file's exceeds upload limit. Please try again.");
        }
    }
    return $errors;
}