From 9f2097e788dfb79c2f95085025934c3134a3eb38 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Tue, 14 Mar 2023 20:24:21 +0100 Subject: [PATCH] fix: empty file can't be uploaded in chrome --- backend/src/file/file.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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,