diff --git a/backend/src/file/file.controller.ts b/backend/src/file/file.controller.ts index f51ca4422..551c5b7cb 100644 --- a/backend/src/file/file.controller.ts +++ b/backend/src/file/file.controller.ts @@ -32,7 +32,8 @@ export class FileController { ) { const { id, name, chunkIndex, totalChunks } = query; - const data = body.toString().split(",")[1]; + // Data can be empty if the file is empty + const data = body.toString().split(",")[1] ?? ""; return await this.fileService.create( data,