Index: file.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/file.inc,v
retrieving revision 1.17.2.5
diff -u -r1.17.2.5 file.inc
--- file.inc	17 Sep 2010 06:56:57 -0000	1.17.2.5
+++ file.inc	18 Sep 2010 05:27:40 -0000
@@ -157,6 +169,11 @@
   $base_success = file_check_directory($base_dir, FILE_CREATE_DIRECTORY);
 
   $destination_dir = $base_dir . '/' . $element['#value'];
+
+  // Try to make the directory recursively before calling file_check_directory().
+  // This may be removed in D7, as recusive is the default there.
+  @mkdir($destination_dir, 0775, TRUE);
+
   $destination_success = file_check_directory($destination_dir, FILE_CREATE_DIRECTORY);
   if (!$base_success || !$destination_success) {
     form_set_error('savelocation', t('The save directory %directory could not be created. Check that the webform files directory is writtable.', array('%directory' => $destination_dir)));
@@ -610,4 +627,4 @@
   }
 
   return $files[$fid];
-}
\ No newline at end of file
+}
