--- webform_validation.validators.inc	2011-03-27 11:39:31.000000000 -0700
+++ webform_validation.validators.inc.new.maxfilesize	2011-06-23 10:11:22.000000000 -0700
@@ -88,6 +88,18 @@ function webform_validation_webform_vali
       ),
       'description' => t('Verifies that a user-entered value contains at most the specified number of words'),
     ),
+    'maxfilesize' => array( // Additional validator
+      'name' => "Maximum file size",
+      'component_types' => array(
+        'file',
+      ),
+      'custom_data' => array(
+        'label' => t('Maximum file size (in KB)'),
+        'description' => t('Specify the maximum file size for your uploads (in KB). Notes: The PHP limit for this server will override this setting. This can also be set in the settings of the file component.'),
+        'required' => TRUE,
+      ),
+      'description' => t('Verifies that an uploaded file from a file field does not exceed a user-set amount.'),
+    ),
     'equal' => array(
       'name' => "Equal values",
       'component_types' => array(
@@ -332,6 +344,17 @@ function webform_validation_webform_vali
  		    }
  		    return $errors;
  		    break;
+ 		    
+      case "maxfilesize": // Additional validation
+        $max_file_size = intval($rule['data'])*1000; // convert KB into bytes
+        foreach($items as $key=>$value) {
+            $loc_form_key = $components[$key]['form_key'];
+            if ($_FILES['files']['size'][$loc_form_key] > $max_file_size) { // ensure that the file exists by file byte size > 0
+                $errors[$key] = t('The file upload from %item is over the limit of %num KB. (Actual file size: %size). Note - Check the settings for the max filesize setting for the file component itself as well if you think you have reached this message in error.', array('%item' => $components[$key]['name'], '%size' => sprintf("%01.2f KB", $_FILES['files']['size'][$loc_form_key]/1000), '%num' => $max_file_size/1000));
+            }
+        }
+        return $errors;
+        break;
       case "equal":
         $first_entry_key = key($items);
         $first_entry = array_shift($items);
