Index: upload_element.pages.inc
===================================================================
--- upload_element.pages.inc	(revision 793)
+++ upload_element.pages.inc	(working copy)
@@ -125,8 +125,12 @@
 
   form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
   $output = theme('status_messages');
+  
+  // For some reason, file uploads don't like drupal_json() with its manual
+  // setting of the text/javascript HTTP header. So use this one instead.
+  $GLOBALS['devel_shutdown'] = false;
   print drupal_to_js(array('status' => TRUE, 'data' => $output));
-  exit();
+  exit;
 }
 
 
