mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-44: Remove now-unnecessary getBase64() implementation within ManagedFileUpload (base64 conversion is handled by REST service).
This commit is contained in:
@@ -28,7 +28,6 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector'
|
|||||||
var ManagedFileTransferState = $injector.get('ManagedFileTransferState');
|
var ManagedFileTransferState = $injector.get('ManagedFileTransferState');
|
||||||
|
|
||||||
// Required services
|
// Required services
|
||||||
var $window = $injector.get('$window');
|
|
||||||
var tunnelService = $injector.get('tunnelService');
|
var tunnelService = $injector.get('tunnelService');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,26 +82,6 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector'
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts the given bytes to a base64-encoded string.
|
|
||||||
*
|
|
||||||
* @param {Uint8Array} bytes A Uint8Array which contains the data to be
|
|
||||||
* encoded as base64.
|
|
||||||
* @return {String} The base64-encoded string.
|
|
||||||
*/
|
|
||||||
var getBase64 = function getBase64(bytes) {
|
|
||||||
|
|
||||||
var data = "";
|
|
||||||
|
|
||||||
// Produce binary string from bytes in buffer
|
|
||||||
for (var i=0; i<bytes.byteLength; i++)
|
|
||||||
data += String.fromCharCode(bytes[i]);
|
|
||||||
|
|
||||||
// Convert to base64
|
|
||||||
return $window.btoa(data);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ManagedFileUpload which uploads the given file to the
|
* Creates a new ManagedFileUpload which uploads the given file to the
|
||||||
* server through the given Guacamole client.
|
* server through the given Guacamole client.
|
||||||
|
Reference in New Issue
Block a user