diff -rupN swfupload-2.0-beta8/js/swfupload_widget.js swfupload/js/swfupload_widget.js
--- swfupload-2.0-beta8/js/swfupload_widget.js	2011-07-19 10:52:30.000000000 +0200
+++ swfupload/js/swfupload_widget.js	2011-07-19 10:26:27.000000000 +0200
@@ -131,7 +131,32 @@ function SWFU(id, settings) {
    * For all files in the stack, a file element will be added to the wrapper using ref.addFileItem().
    */
   ref.addStoredFiles = function() {
-    for(var i in ref.upload_stack) {
+	
+	// Sort by weight
+	var tempFiles = new Array();
+	for(var i in ref.upload_stack) {
+		if (ref.upload_stack[i] == 0) {
+	        break;
+	      };
+       
+         weight = ref.upload_stack[i]['weight'];
+         tempFiles[weight] = ref.upload_stack[i];
+	};
+	
+	for(var i in tempFiles) {
+		  fid = tempFiles[i]['fid']
+	      ref.upload_stack[fid].id = fid;
+	      ref.upload_stack[fid].fid = fid;
+	      ref.upload_stack[fid].extension = ref.getExtension(ref.upload_stack[fid].filename);
+	      ref.addFileItem(ref.upload_stack[fid]);
+
+	      // Adjust the bytes in the stack.
+	      ref.upload_stack_size += parseInt(ref.upload_stack[fid].filesize);	
+	};
+	
+	/*
+    for(var i in ref.upload_stack) { 
+	  
       if (ref.upload_stack[i] == 0) {
         break;
       };
@@ -142,7 +167,9 @@ function SWFU(id, settings) {
 
       // Adjust the bytes in the stack.
       ref.upload_stack_size += parseInt(ref.upload_stack[i].filesize);
+	  
     };
+	*/
     ref.addEventHandlers('drag_enable');
   };
 
@@ -728,27 +755,34 @@ function SWFU(id, settings) {
     var old_upload_stack = ref.upload_stack;
     var total_size = 0;
     ref.upload_stack = {};
-
+    weight = 0
+    
     ref.wrapper_obj.find('.processed').each(function() {
       fid = $(this).attr('id');
-
+	  
       // If no file is secified, the function is called after sorting
       // There are no new values so the file object is not needed
       // We only need to change the order of the stack 
       if (!file) {
         ref.upload_stack[fid] = old_upload_stack[fid];
+		ref.upload_stack[fid]['weight'] = weight
       }
       else {
         ref.upload_stack[fid] = {filename:file.filename || file.name, fid:fid};
+        ref.upload_stack[fid]['weight'] = weight
+
         total_size += parseInt(file.size);
         for (var name in ref.instance.elements) {
           input_field = $('#edit-' + name + '_' + fid);
           if (input_field.size() !== 0) {
-            ref.upload_stack[fid][name] = (input_field.attr('type') == 'checkbox') ? input_field.attr('checked') : input_field.val();
+            ref.upload_stack[fid][name]  = (input_field.attr('type') == 'checkbox') ? input_field.attr('checked') : input_field.val();
           };
         };
       };
+
+	  weight += 1;
     });
+
     ref.upload_stack_size = total_size;
     ref.upload_stack_length = ref.objectLength(ref.upload_stack);
     ref.upload_stack_obj.val(ref.toJson(ref.upload_stack));
diff -rupN swfupload-2.0-beta8/swfupload.module swfupload/swfupload.module
--- swfupload-2.0-beta8/swfupload.module	2011-07-19 10:52:33.000000000 +0200
+++ swfupload/swfupload.module	2011-07-19 10:50:07.000000000 +0200
@@ -180,6 +180,7 @@ function swfupload_add_js($element) {
         'max_queue_size' => ($field['widget']['max_filesize_per_node'] ? $field['widget']['max_filesize_per_node'] : 0),
       ),
     );
+
     drupal_add_js('misc/tabledrag.js', 'core');
     drupal_add_js("$path/js/swfupload_widget.js");
     drupal_add_js($settings, 'setting');
@@ -348,4 +349,4 @@ function swfupload_to_js($var) {
   else {
     return str_replace(array('\x3c', '\x3e', '\x26'), array('\u003c', '\u003e', '\u0026'), drupal_to_js($var));
   }
-}
+}
\ No newline at end of file
diff -rupN swfupload-2.0-beta8/swfupload_widget.inc swfupload/swfupload_widget.inc
--- swfupload-2.0-beta8/swfupload_widget.inc	2011-07-19 10:52:33.000000000 +0200
+++ swfupload/swfupload_widget.inc	2011-07-19 10:25:47.000000000 +0200
@@ -55,6 +55,7 @@ function swfupload_widget_validate(&$ele
             'description' => $file['description'],
             'alt' => $file['alt'],
             'title' => $file['title'],
+			'weight' => $file['weight'],
           ),
         )
       );
@@ -86,6 +87,7 @@ function swfupload_widget_value($element
             'alt' => $tmp_file['data']['alt'],
             'title' => $tmp_file['data']['title'],
             'list' => $tmp_file['list'],
+ 			'weight' => $tmp_file['data']['weight'],
           );
 
           // If we're dealing with an image, create a thumbpath
