### Eclipse Workspace Patch 1.0
#P fluid-components
Index: src/webapp/fluid-components/js/fluid/uploader/Uploader.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/Uploader.js	(revision 6217)
+++ src/webapp/fluid-components/js/fluid/uploader/Uploader.js	(working copy)
@@ -451,6 +451,11 @@
         renderUploadTotalMessage(that);
     };
     
+    var updateStateAfterError = function (that) {
+        that.totalProgress.hide();
+        setStateLoaded(that);
+    };
+    
     var updateStateAfterCompletion = function (that) {
         hideTotalProgress(that);
         if (that.uploadManager.queue.getReadyFiles().length === 0) {
@@ -479,8 +484,7 @@
         
         that.events.onFileError.addListener(function (file, error, message) {
             if (error === fluid.uploader.errorConstants.UPLOAD_STOPPED) {
-                // user stopped
-                updateStateAfterCompletion(that);
+                updateStateAfterError(that);
             }
         });
 
Index: src/webapp/fluid-components/js/fluid/uploader/SWFUploadManager.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/SWFUploadManager.js	(revision 6217)
+++ src/webapp/fluid-components/js/fluid/uploader/SWFUploadManager.js	(working copy)
@@ -261,8 +261,8 @@
 
 (function ($, fluid) {
     
-    var updateProgress = function (file, events, demoState) {
-        if (demoState.shouldPause) {
+    var updateProgress = function (file, events, demoState, isUploading) {
+        if (!isUploading) {
             return;
         }
         
@@ -272,28 +272,27 @@
     };
     
     var finishUploading = function (that) {
-        var file = that.demoState.currentFile;
-        file.filestatus = fluid.uploader.fileStatusConstants.COMPLETE;
-        that.events.onFileSuccess.fire(file);
-        that.invokeAfterRandomDelay(function () {
+        if (that.queue.isUploading) {
+            var file = that.demoState.currentFile;
+            file.filestatus = fluid.uploader.fileStatusConstants.COMPLETE;
+            that.events.onFileSuccess.fire(file);
             that.demoState.fileIdx++;
             that.swfUploadSettings.upload_complete_handler(file); // this is a hack that needs to be addressed.
-        });     
+        }
     };
     
     var simulateUpload = function (that) {
-        if (that.demoState.shouldPause) {
-            return;
-        }
         var file = that.demoState.currentFile;
-        that.invokeAfterRandomDelay(function () {
+        if (that.queue.isUploading) {
             if (that.demoState.bytesUploaded < file.size) {
-                updateProgress(file, that.events, that.demoState);
-                simulateUpload(that);
+                that.invokeAfterRandomDelay(function () {
+                    updateProgress(file, that.events, that.demoState, that.queue.isUploading);
+                    simulateUpload(that);
+                });
             } else {
-                finishUploading(that);
-            }
-        });
+            finishUploading(that);
+            } 
+        }
     };
     
     var startUploading = function (that) {
@@ -301,7 +300,7 @@
         that.demoState.currentFile = that.queue.files[that.demoState.fileIdx];
         that.demoState.chunksForCurrentFile = Math.ceil(that.demoState.currentFile / that.demoState.chunkSize);
         that.demoState.bytesUploaded = 0;
-        that.demoState.shouldPause = false;
+        that.queue.isUploading = true;
         
         that.events.onFileStart.fire(that.demoState.currentFile);
         that.demoState.currentFile.filestatus = fluid.uploader.fileStatusConstants.IN_PROGRESS;
@@ -309,15 +308,12 @@
     };
 
     var pauseDemo = function (that) {
-        that.demoState.shouldPause = true;
         that.demoState.currentFile.filestatus = fluid.uploader.fileStatusConstants.CANCELLED;
         
         // In SWFUpload's world, pausing is a combinination of an UPLOAD_STOPPED error and a complete.
         that.events.onFileError.fire(that.demoState.currentFile, 
                                        fluid.uploader.errorConstants.UPLOAD_STOPPED, 
                                        "The demo upload was paused by the user.");
-        // This is a hack that needs to be addressed.
-        that.swfUploadSettings.upload_complete_handler(that.demoState.currentFile);
     };
     
     var initDemoUploadManager = function (events, options) {
