diff --git a/components/file.inc b/components/file.inc
index 4662011..e47b755 100644
--- a/components/file.inc
+++ b/components/file.inc
@@ -5,6 +5,8 @@
  * Webform module file component.
  */
 
+define('FILE_NAME_IGNORE_WORDS', "a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with");
+
 /**
  * Implements _webform_defaults_component().
  */
@@ -21,6 +23,7 @@ function _webform_defaults_file() {
         'addextensions' => '',
         'size' => '2 MB',
       ),
+      'rename' => '',
       'scheme' => 'public',
       'directory' => '',
       'progress_indicator' => 'throbber',
@@ -156,6 +159,14 @@ function _webform_edit_file($component) {
       '#field_prefix' => 'webform/',
     );
 
+    $form['extra']['rename'] = array(
+      '#type' => 'textfield',
+      '#title' => t('New File Name'),
+      '#default_value' => $component['extra']['rename'],
+      '#description' => t('Rename the file with tokens (please don\'t include extension, leave empty if you don\'t want to rename), Supports Webform token replacements.').' '.theme('webform_token_help', array('groups' => array('node', 'submission'))),
+      '#weight' => 6,
+    );
+
     $form['display']['progress_indicator'] = array(
       '#type' => 'radios',
       '#title' => t('Progress indicator'),
@@ -539,3 +550,26 @@ function webform_file_usage_adjust($submission) {
     }
   }
 }
+
+/**
+ * Clean filename by removing spaces and special characters.
+ */
+function webform_file_rename_clean_name($output) {
+  $ignore_words_regex = preg_replace(array('/^[,\s]+|[,\s]+$/', '/[,\s]+/'), array('', '\b|\b'), FILE_NAME_IGNORE_WORDS);
+  $ignore_words_regex = '/' .'\b' . $ignore_words_regex . '\b'. '/i';
+
+  $output = preg_replace('/&#0*39;|\'/', '', $output);
+  $output = preg_replace('/[^a-zA-Z0-9\/]+/', '-', $output);
+  $words_removed = preg_replace($ignore_words_regex, '', $output);
+
+  if (drupal_strlen(trim($words_removed)) > 0) {
+    $output = $words_removed;
+  }
+  $output = ltrim($output, '-');
+  $output = rtrim($output, '-');
+  $output = trim($output);
+  $output = preg_replace('/\s[\s]+/','-',$output);
+  $output = drupal_strtolower($output);
+  return $output;
+}
+
diff --git a/webform.module b/webform.module
index 07c0ff3..5001e52 100644
--- a/webform.module
+++ b/webform.module
@@ -1224,6 +1224,11 @@ function webform_webform_submission_presave($node, &$submission) {
           }
         }
         $new_fids = array_merge($new_fids, $submission->data[$cid]);
+
+        if (!empty($component['extra']['rename'])) {
+          webform_file_process_rename_action($node, $submission, $component, $submission->data[$cid][0]);
+        }
+
       }
     }
   }
@@ -1255,6 +1260,42 @@ function webform_webform_submission_presave($node, &$submission) {
 }
 
 /**
+ * Function to rename the uploaded file name based on the text we entered on
+ * file component.
+ * @param $node
+ * @param $submission
+ * @param $file
+ */
+function webform_file_process_rename_action($node, $submission, $component, $fid) {
+  webform_component_include('file');
+  $file = webform_get_file($fid);
+
+  if ($file) {
+    // Get the destination uri.
+    $scheme = $component['extra']['scheme'];
+    $directory = $component['extra']['directory'];
+    $destination_dir = file_stream_wrapper_uri_normalize($scheme . '://webform/' . $directory);
+
+    // Get the file extension.
+    $info = pathinfo($file->uri);
+    $extension = $info['extension'];
+
+    // Prepare new file name without extension.
+    $rename = webform_replace_tokens($component['extra']['rename'], $node, $submission, NULL, TRUE);
+    $new_file_name = webform_file_rename_clean_name($rename);
+
+    // Prepare the new uri with new filename.
+    $destination = $destination_dir ."/$new_file_name.$extension";
+
+    // Compare the uri and Rename the file name.
+    if ($file->uri != $destination) {
+      $new_file = file_move($file, $destination, FILE_EXISTS_RENAME);
+    }
+  }
+}
+
+
+/**
  * Implements hook_webform_submission_insert().
  */
 function webform_webform_submission_insert($node, $submission) {
