--- modules/upload/old_upload.module	2008-03-27 04:30:20.000000000 +0100
+++ modules/upload/upload.module	2008-03-27 04:30:46.000000000 +0100
@@ -610,6 +610,8 @@
       $form['files'][$fid]['weight']['#default_value'] = $file['weight'];
     }
   }
+  
+  drupal_alter('form', $form, array(), 'upload_js');
 
   // Add the new element to the stored form state and resave.
   $cache->data['attachments']['wrapper'] = array_merge($cache->data['attachments']['wrapper'], $form);
@@ -622,7 +624,6 @@
     '#tree' => FALSE,
     '#parents' => array(),
   );
-  drupal_alter('form', $form, array(), 'upload_js');
   $form_state = array('submitted' => FALSE);
   $form = form_builder('upload_js', $form, $form_state);
   $output = theme('status_messages') . drupal_render($form);
