--- webform_validation.validators.inc	2011-03-27 11:39:31.000000000 -0700
+++ webform_validation.validators.inc.new	2011-06-22 18:39:12.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). Note: The PHP limit for this server will override this setting.'),
+        '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(
@@ -150,6 +162,18 @@ function webform_validation_webform_vali
       'min_components' => 2,
       'description' => t('Forces the user to specify / select at least one of several selected webform components'),
     ),
+    'oneofseveral_expanded' => array( // Additional validator
+      'name' => "Require at least one of several fields - Expanded",
+      'component_types' => array(
+        'textfield',
+        'textarea',
+        'email',
+        'select',
+        'file',
+      ),
+      'min_components' => 2,
+      'description' => t('Same functionality as oneoftwo or oneofseveral, except this checks file fields as well and adds a custom error message when only two fields are selected.'),
+    ),
     'select_min' => array(
       'name' => "Minimum number of selections required",
       'component_types' => array(
@@ -332,6 +356,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).', 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);
@@ -407,6 +442,37 @@ function webform_validation_webform_vali
           return array($keys[0] => t('You have to specify at least one of these items:') . theme('item_list', $names));
         }
         break;
+      case "oneofseveral_expanded":
+        // $components should have at least 2 items - no need to check due to params in rule
+        $keys = array_keys($items);
+        $entryN = array();
+        foreach($keys as $jj=>$kk) {
+            if ($components[$kk]['type'] == 'file') { // Is it a file field?
+                $loc_form_key = $components[$kk]['form_key'];
+                if ($_FILES['files']['size'][$loc_form_key] > 0) { // ensure that the file exists by file byte size > 0
+                    $entryN[$jj] = $_FILES['files']['name'][$loc_form_key]; // sets with the file name
+                }
+                else { 
+                    $entryN[$jj] = ''; // empty
+                }
+            }
+            else { // non-file fields
+                $entryN[$jj] = _webform_validation_flatten_array($items[$kk]);
+            }
+        }
+        if (count(array_filter($entryN)) < 1) { // Are all the elements empty?
+            $names = array();
+            foreach ($keys as $value) {
+                $names[] = $components[$value]['name'];
+            }
+            if (count($keys) == 2) { // custom error msg for only two items
+                return array($keys[0] => t('You have to specify %item1 or %item2 (or both)', array('%item1' => $components[$keys[0]]['name'], '%item2' => $components[$keys[1]]['name'])));
+            }
+            else { // default error msg for three or more items
+                return array($keys[0] => t('You have to specify at least one of these items:') . theme('item_list', $names));
+            }
+        }
+        break;
       case "select_min":
         $min_selections = $rule['data'];
         foreach ($items as $key => $val) {
