GUACAMOLE-44: Remove now-unnecessary getBase64() implementation within ManagedFileUpload (base64 conversion is handled by REST service).

This commit is contained in:
Michael Jumper
2016-06-05 17:00:46 -07:00
parent f207b29cc6
commit 0b6faba258

View File

@@ -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.