GUAC-1172: Implement file upload through object streams.
This commit is contained in:
1 parent
cfd3710bf2
commit
daf52dee5e
4 files changed
+62
-4
No files matched your search
@@ -27,6 +27,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
function clientController($scope, $routeParams, $injector) {
|
||||
|
||||
// Required types
|
||||
var ManagedClient = $injector.get('ManagedClient');
|
||||
var ManagedClientState = $injector.get('ManagedClientState');
|
||||
var ManagedFilesystem = $injector.get('ManagedFilesystem');
|
||||
var ScrollState = $injector.get('ScrollState');
|
||||
@@ -635,6 +636,25 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
ManagedFilesystem.changeDirectory(filesystem, file);
|
||||
};
|
||||
|
||||
/**
|
||||
* Begins a file upload through the attached Guacamole client for
|
||||
* each file in the given FileList.
|
||||
*
|
||||
* @param {FileList} files
|
||||
* The files to upload.
|
||||
*/
|
||||
$scope.uploadFiles = function uploadFiles(files) {
|
||||
|
||||
// Ignore file uploads if no attached client
|
||||
if (!$scope.client)
|
||||
return;
|
||||
|
||||
// Upload each file
|
||||
for (var i = 0; i < files.length; i++)
|
||||
ManagedClient.uploadFile($scope.client, files[i], $scope.filesystemMenuContents);
|
||||
|
||||
};
|
||||
|
||||
// Clean up when view destroyed
|
||||
$scope.$on('$destroy', function clientViewDestroyed() {
|
||||
|
||||
|
||||
Reference in new issue
Block a user