mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1320: Provide chunked file upload mechanism - add sendEnd()
This commit is contained in:
@@ -163,12 +163,14 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector'
|
|||||||
|
|
||||||
// Upload complete
|
// Upload complete
|
||||||
managedFileUpload.progress = file.size;
|
managedFileUpload.progress = file.size;
|
||||||
|
|
||||||
|
// Close the stream
|
||||||
|
stream.sendEnd();
|
||||||
ManagedFileTransferState.setStreamState(managedFileUpload.transferState,
|
ManagedFileTransferState.setStreamState(managedFileUpload.transferState,
|
||||||
ManagedFileTransferState.StreamState.CLOSED);
|
ManagedFileTransferState.StreamState.CLOSED);
|
||||||
|
|
||||||
// Notify of upload completion
|
// Notify of upload completion
|
||||||
$rootScope.$broadcast('guacUploadComplete', file.name);
|
$rootScope.$broadcast('guacUploadComplete', file.name);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Notify if upload fails
|
// Notify if upload fails
|
||||||
@@ -186,11 +188,15 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector'
|
|||||||
ManagedFileTransferState.StreamState.ERROR,
|
ManagedFileTransferState.StreamState.ERROR,
|
||||||
Guacamole.Status.Code.INTERNAL_ERROR);
|
Guacamole.Status.Code.INTERNAL_ERROR);
|
||||||
|
|
||||||
|
// Close the stream
|
||||||
|
stream.sendEnd();
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Ignore all further acks
|
// Ignore all further acks
|
||||||
stream.onack = null;
|
stream.onack = null;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return managedFileUpload;
|
return managedFileUpload;
|
||||||
|
Reference in New Issue
Block a user