--- file_service.inc.original.2	2009-04-01 20:31:26.000000000 -0700
+++ file_service.inc	2009-04-01 21:27:24.000000000 -0700
@@ -146,6 +146,13 @@ function file_service_save($file) {
     variable_get('upload_extensions_default', 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp'));
   }
 
+  // Get the directory name for the location of the file:
+  $dir = dirname($file->filepath);
+  // Build the destination folder tree if it doesn't already exists.
+  if (!file_check_directory($dir, FILE_CREATE_DIRECTORY) && !mkdir($dir, 0775, true)) {
+    return services_error("Could not create destination directory for file.");
+  }
+
   // Update file object as necessary
   $file->filepath = file_destination(file_create_path($file->filepath), FILE_EXISTS_RENAME);
   $file->filename = file_munge_filename(trim(basename($file->filepath), '.'), $extensions, TRUE);
@@ -160,7 +167,7 @@ function file_service_save($file) {
 
   // If the destination is not provided, or is not writable, error our
   if (empty($file->filepath) || file_check_path($file->filepath) === FALSE) {
-    return services_error("Destintion directory does not exist or is not writeable.");
+    return services_error("Destination directory does not exist or is not writeable.");
   }
 
   // Write the file
