Support tool, zips folder and puts it to users home directory (#870)

* Support tool, zips folder and puts it in users home directory
This commit is contained in:
Anton Shepilov
2025-04-07 14:25:04 +02:00
committed by GitHub
parent 755c4f05e2
commit 22e30d20fb
9 changed files with 470 additions and 6 deletions
@@ -1405,7 +1405,7 @@ export class DocumentsService {
if (file) {
const fileEntity = await globalResolver.services.files.save(
null,
file,
file.file,
{
...options,
filename: options.filename ?? driveFile.name,
@@ -67,7 +67,7 @@ export class DocumentsController {
ignoreThumbnails: true,
};
createdFile = await globalResolver.services.files.save(null, file, options, context);
createdFile = await globalResolver.services.files.save(null, file?.file, options, context);
}
const { item, version } = request.body;
@@ -73,7 +73,7 @@ export class FileServiceImpl {
async save(
id: string,
file: MultipartFile,
file: Readable,
options: UploadOptions,
context: CompanyExecutionContext,
): Promise<File> {
@@ -136,10 +136,10 @@ export class FileServiceImpl {
}
let totalUploadedSize = 0;
file.file.on("data", function (chunk) {
file.on("data", function (chunk) {
totalUploadedSize += chunk.length;
});
await gr.platformServices.storage.write(getFilePath(entity), file.file, {
await gr.platformServices.storage.write(getFilePath(entity), file, {
chunkNumber: options.chunkNumber,
encryptionAlgo: this.algorithm,
encryptionKey: entity.encryption_key,
@@ -34,7 +34,7 @@ export class FileController {
};
const id = request.params.id;
const result = await gr.services.files.save(id, file, options, context);
const result = await gr.services.files.save(id, file?.file, options, context);
return {
resource: result.getPublicObject(),