--- modules/file/file.module	2010-12-29 06:35:23.000000000 +0200
+++ modules/file/file_NEW.module	2011-09-28 13:17:23.224311164 +0200
@@ -274,11 +274,12 @@ function file_ajax_upload() {
     $form['#suffix'] .= '<span class="ajax-new-content"></span>';
   }
 
-  $output = theme('status_messages') . drupal_render($form);
+  $output = '<div class="file-upload-js-error">' . theme('status_messages') . '</div>' . drupal_render($form);
   $js = drupal_add_js();
   $settings = call_user_func_array('array_merge_recursive', $js['settings']['data']);
 
   $commands = array();
+  $commands[] = ajax_command_remove('.file-upload-js-error');
   $commands[] = ajax_command_replace(NULL, $output, $settings);
   return array('#type' => 'ajax', '#commands' => $commands);
 }
