diff -urP drupal-7.x-dev/includes/file.inc drupal7/includes/file.inc
--- drupal-7.x-dev/includes/file.inc	2008-10-12 11:30:05.000000000 +0700
+++ drupal7/includes/file.inc	2008-10-17 21:01:16.000000000 +0700
@@ -811,7 +811,6 @@
   // Add in our check of the the file name length.
   $validators['file_validate_name_length'] = array();
 
-
   // If a file was uploaded, process it.
   if (isset($_FILES['files']) && $_FILES['files']['name'][$source] && is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
     // Check for file upload errors and return FALSE if a lower level system
diff -urP drupal-7.x-dev/includes/form.inc drupal7/includes/form.inc
--- drupal-7.x-dev/includes/form.inc	2008-10-15 21:17:26.000000000 +0700
+++ drupal7/includes/form.inc	2008-10-17 20:48:02.000000000 +0700
@@ -1869,6 +1869,7 @@
       case 'radio':
       case 'checkbox':
       case 'select':
+      case 'file':
         $element['#ahah']['event'] = 'change';
         break;
       default:
diff -urP drupal-7.x-dev/modules/system/system.module drupal7/modules/system/system.module
--- drupal-7.x-dev/modules/system/system.module	2008-10-15 03:44:57.000000000 +0700
+++ drupal7/modules/system/system.module	2008-10-17 20:47:28.000000000 +0700
@@ -309,6 +309,8 @@
   $type['file'] = array(
     '#input' => TRUE,
     '#size' => 60,
+    // modification to allow uploads to be attached to onchange event
+    '#process' => array('form_process_ahah'),
   );
 
 
diff -urP drupal-7.x-dev/modules/upload/upload.module drupal7/modules/upload/upload.module
--- drupal-7.x-dev/modules/upload/upload.module	2008-10-12 09:42:56.000000000 +0700
+++ drupal7/modules/upload/upload.module	2008-10-17 20:58:11.000000000 +0700
@@ -538,16 +538,17 @@
       '#title' => t('Attach new file'),
       '#size' => 40,
       '#description' => $limit_description,
-    );
-    $form['new']['attach'] = array(
-      '#type' => 'submit',
-      '#value' => t('Attach'),
-      '#name' => 'attach',
       '#ahah' => array(
         'path' => 'upload/js',
         'wrapper' => 'attach-wrapper',
+        'event' => 'change',
         'progress' => array('type' => 'bar', 'message' => t('Please wait...')),
       ),
+    );
+    $form['new']['attach'] = array(
+      '#type' => 'submit',
+      '#value' => t('Attach'),
+      '#name' => 'attach',
       '#submit' => array('node_form_submit_build_node'),
     );
   }
