GUACAMOLE-1320: Provide chunked file upload mechanism - add sendEnd()

This commit is contained in:
elijahnicpon
2022-07-27 20:26:17 -04:00
parent c9a2fc249e
commit 003f7e945a

View File

@@ -163,12 +163,14 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector'
// Upload complete
managedFileUpload.progress = file.size;
// Close the stream
stream.sendEnd();
ManagedFileTransferState.setStreamState(managedFileUpload.transferState,
ManagedFileTransferState.StreamState.CLOSED);
// Notify of upload completion
$rootScope.$broadcast('guacUploadComplete', file.name);
},
// Notify if upload fails
@@ -186,11 +188,15 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector'
ManagedFileTransferState.StreamState.ERROR,
Guacamole.Status.Code.INTERNAL_ERROR);
// Close the stream
stream.sendEnd();
}));
// Ignore all further acks
stream.onack = null;
};
return managedFileUpload;