mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 06:31:22 +00:00
GUAC-1172: Implement file upload through object streams.
This commit is contained in:
@@ -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