From c1221596172f97271c6b3c0614117379069a1142 Mon Sep 17 00:00:00 2001 From: MarvinKlein1508 Date: Wed, 23 Apr 2025 08:46:59 +0200 Subject: [PATCH] Fix uploading 0 byte files (#3717) --- src/Core/Components/InputFile/FluentInputFile.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Components/InputFile/FluentInputFile.razor.cs b/src/Core/Components/InputFile/FluentInputFile.razor.cs index cf9cdf1229..648abbd005 100644 --- a/src/Core/Components/InputFile/FluentInputFile.razor.cs +++ b/src/Core/Components/InputFile/FluentInputFile.razor.cs @@ -403,7 +403,7 @@ private async Task ReadFileToBufferAndRaiseProgressEventAsync(IBrowserFile file, private Task UpdateProgressAsync(long current, long size, string title) { - return UpdateProgressAsync(Convert.ToInt32(decimal.Divide(current, size) * 100), title); + return UpdateProgressAsync(Convert.ToInt32(decimal.Divide(current, size <= 0 ? 1 : size) * 100), title); } private async Task UpdateProgressAsync(int percent, string title)