Index: includes/file.inc
===================================================================
--- includes/file.inc	(revision 26)
+++ includes/file.inc	(working copy)
@@ -191,29 +191,35 @@ function file_check_upload($source = 'up
   if (isset($upload_cache[$source])) {
     return $upload_cache[$source];
   }
-
-  // If a file was uploaded, process it.
-  if ($_FILES["files"]["name"][$source] && is_uploaded_file($_FILES["files"]["tmp_name"][$source])) {
+  
+  if ($_FILES["files"]["name"][$source] ) {
 
     // Check for file upload errors and return FALSE if a
     // lower level system error occurred.
     switch ($_FILES["files"]["error"][$source]) {
 
       // @see http://php.net/manual/en/features.file-upload.errors.php
-      case UPLOAD_ERR_OK:
-        break;
 
       case UPLOAD_ERR_INI_SIZE:
+        drupal_set_message(t("The file %file could not be saved, because it exceeds the server's upload file size limit of %maxsize.", array('%file' => $_FILES['files']['name'][$source], '%maxsize' => format_size(parse_size(ini_get('upload_max_filesize'))))), 'error');
+         return 0;
+
       case UPLOAD_ERR_FORM_SIZE:
-        drupal_set_message(t('The file %file could not be saved, because it exceeds the maximum allowed size for uploads.', array('%file' => $source)), 'error');
+        drupal_set_message(t("The file %file could not be saved, because it exceeds this form's size limit for file uploads.", array('%file' => $_FILES['files']['name'][$source])), 'error');
         return 0;
 
       case UPLOAD_ERR_PARTIAL:
       case UPLOAD_ERR_NO_FILE:
-        drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => $source)), 'error');
+        drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => $_FILES['files']['name'][$source])), 'error');
         return 0;
+     
+      case UPLOAD_ERR_OK:
+         // Final check that this is a valid upload, if it isn't, use the
+         // default error handler.
+         if (is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
+           break;
+         }
 
-      // Unknown error
       default:
         drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source)),'error');
         return 0;
