Skip to content

Commit

Permalink
fix: empty file can't be uploaded in chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Mar 14, 2023
1 parent 2158df4 commit 9f2097e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/file/file.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9f2097e

Please sign in to comment.