diff --git a/comment_upload.module b/comment_upload.module
index 4cb9ca0..3948d7e 100644
--- a/comment_upload.module
+++ b/comment_upload.module
@@ -69,6 +69,17 @@ function comment_upload_form_alter(&$form, $form_state, $form_id) {
       '#weight' => 20,
     );
 
+    $path = file_directory_path();
+    $form['comment']['comment_upload_path'] = array(
+      '#type' => 'textfield',
+      '#title' => t('File path for attachments on comments'),
+      '#description' => t('Optional subdirectory within the <em>!path</em> directory where files will be stored. Do not include preceding or trailing slashes.', array('!path' => $path)),
+      '#default_value' => variable_get('comment_upload_path_' . $form['#node_type']->type, NULL),
+      '#size' => 40,
+      '#maxlength' => 255,
+      '#weight' => 20,
+    );
+
     $image_options = array(
       'none' => t('Display as attachment'),
       'inline' => t('Display as full image'),
@@ -86,6 +97,7 @@ function comment_upload_form_alter(&$form, $form_state, $form_id) {
       '#options' => $image_options,
       '#weight' => 20,
     );
+    $form['#validate'][] = 'comment_upload_validate_path';
   }
   elseif ($form_id == 'comment_form') {
     comment_upload_alter_comment_form($form, $form_state);
@@ -93,6 +105,14 @@ function comment_upload_form_alter(&$form, $form_state, $form_id) {
 }
 
 /**
+ * Check to see if the user-specified path for comment uploads exists or can be created.
+ */
+function comment_upload_validate_path($form, $form_state) {
+  $path = file_directory_path() . '/' . $form_state['values']['comment_upload_path'];
+  file_check_directory($path, 1, 'comment_upload_path');
+}
+
+/**
  * Alter the comment form to support AHAH uploads.
  *
  * Note; not a hook implementation.
@@ -475,8 +495,19 @@ function comment_upload_process_files(&$form, &$form_state) {
     'file_validate_size' => array($limits['file_size'], $limits['user_size']),
   );
 
+  // Get file path settings, if any
+  if ($node = node_load($form['nid']['#value'])) {
+    $comment_path = variable_get('comment_upload_path_' . $node->type, NULL);
+  }
+  
+  if ($comment_path) {
+    $path = file_directory_path() . '/' . $comment_path;
+  } else {
+    $path = file_directory_path();
+  }
+
   // Save new file uploads.
-  if (user_access('upload files to comments') && ($file = file_save_upload('upload', $validators, file_directory_path()))) {
+  if (user_access('upload files to comments') && ($file = file_save_upload('upload', $validators, $path))) {
     $file->list = variable_get('upload_list_default', 1);
     $file->description = $file->filename;
     $file->weight = 0;
