fix: memory leak while uploading files by disabling base64 encoding of chunks

This commit is contained in:
Elias Schneider
2024-04-04 20:55:45 +02:00
parent 0bfbaea49a
commit 7a15fbb465
4 changed files with 46 additions and 67 deletions

View File

@@ -27,17 +27,14 @@ export class FileController {
@UseGuards(CreateShareGuard, ShareOwnerGuard)
async create(
@Query() query: any,
@Body() body: string,
@Param("shareId") shareId: string,
) {
const { id, name, chunkIndex, totalChunks } = query;
// Data can be empty if the file is empty
const data = body.toString().split(",")[1] ?? "";
return await this.fileService.create(
data,
body,
{ index: parseInt(chunkIndex), total: parseInt(totalChunks) },
{ id, name },
shareId,