mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-06 11:35:50 +08:00
Fix for uploading files to a shared credential
This commit is contained in:
parent
342385232c
commit
a413d48e5f
1 changed files with 16 additions and 2 deletions
|
@ -155,15 +155,29 @@ angular.module('passmanApp')
|
|||
};
|
||||
|
||||
$scope.fileLoaded = function (file) {
|
||||
var key;
|
||||
var _file = {
|
||||
filename: file.name,
|
||||
size: file.size,
|
||||
mimetype: file.type,
|
||||
data: file.data
|
||||
};
|
||||
FileService.uploadFile(_file).then(function (result) {
|
||||
|
||||
if (!$scope.storedCredential.hasOwnProperty('acl') && $scope.storedCredential.hasOwnProperty('shared_key')) {
|
||||
|
||||
if ($scope.storedCredential.shared_key) {
|
||||
key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
|
||||
}
|
||||
}
|
||||
|
||||
if ($scope.storedCredential.hasOwnProperty('acl')) {
|
||||
key = EncryptService.decryptString(angular.copy($scope.storedCredential.acl.shared_key));
|
||||
}
|
||||
|
||||
|
||||
FileService.uploadFile(_file, key).then(function (result) {
|
||||
delete result.file_data;
|
||||
result.filename = EncryptService.decryptString(result.filename);
|
||||
result.filename = EncryptService.decryptString(result.filename, key);
|
||||
$scope.storedCredential.files.push(result);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue