mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
v5.0.1
This commit is contained in:
@ -146,6 +146,24 @@ exports.putObject = function(strPath, buffer, contentLength) {
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.uploadObject = function(strPath, filePath) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
fs.readFile(filePath, (err, data) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(data);
|
||||
}
|
||||
});
|
||||
}).then(function(data) {
|
||||
return exports.putObject(strPath, data, data.length);
|
||||
});
|
||||
};
|
||||
exports.copyObject = function(sourceKey, destinationKey) {
|
||||
return exports.getObject(sourceKey).then(function(data) {
|
||||
return exports.putObject(destinationKey, data, data.length);
|
||||
});
|
||||
};
|
||||
exports.listObjects = function(strPath) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var params = {Bucket: cfgBucketName, Prefix: getFilePath(strPath)};
|
||||
|
||||
Reference in New Issue
Block a user