From ee9219b9ac90014ca6d21d953b37eeba81654e4c Mon Sep 17 00:00:00 2001 From: limited_dev Date: Thu, 8 Jun 2023 23:32:57 +0200 Subject: [PATCH] feat: increased max img size Signed-off-by: limited_dev --- ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor | 2 +- ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor | 2 +- ImageBoardServerApp/Shared/Components/Forms/PostForm.razor | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor b/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor index 5963a85..d632b39 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor @@ -141,7 +141,7 @@ CommentData commentToCreate; if (hasImage) { - Stream stream = selectedFile.OpenReadStream(maxAllowedSize: 512000 * 4); // max 2MB + Stream stream = selectedFile.OpenReadStream(maxAllowedSize: 512000 * 8); // max 4MB var file = Path.GetRandomFileName() + "." + selectedFile.Name.Split(".")[selectedFile.Name.Split(".").Length - 1]; var path = $"{env.WebRootPath}/img/dynamic/comment/{@post.Board}/{@file}"; FileStream fs = File.Create(path); diff --git a/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor b/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor index e1b7279..9b7f853 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor @@ -1,5 +1,5 @@ 
- The max. image size is 2MiB. + The max. image size is 4MiB.
Supported file types are: jpeg, png & gif
diff --git a/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor b/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor index 5f91849..3534e66 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor @@ -145,7 +145,7 @@ return; } - Stream stream = selectedFile.OpenReadStream(maxAllowedSize: 512000 * 4); // max 2MB + Stream stream = selectedFile.OpenReadStream(maxAllowedSize: 512000 * 8); // max 4MB var file = Path.GetRandomFileName() + "." + selectedFile.Name.Split(".")[selectedFile.Name.Split(".").Length - 1]; var path = $"{env.WebRootPath}/img/dynamic/op/{@board.Tag}/{@file}"; FileStream fs = File.Create(path);