mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-15 03:43:14 +02:00
fix: memory leak while uploading files by disabling base64 encoding of chunks
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user