From ae8fe435296c00f6a527cfef8c502905645efc3c Mon Sep 17 00:00:00 2001 From: Flipp Syder <76629141+vulppine@users.noreply.github.com> Date: Thu, 8 Sep 2022 07:02:26 -0700 Subject: [PATCH] Bound uploadfile to the relative path's extension (#11120) --- Content.Client/Administration/Commands/UploadFile.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Client/Administration/Commands/UploadFile.cs b/Content.Client/Administration/Commands/UploadFile.cs index 8e00c5b3dd..5056ef540f 100644 --- a/Content.Client/Administration/Commands/UploadFile.cs +++ b/Content.Client/Administration/Commands/UploadFile.cs @@ -30,9 +30,11 @@ public sealed class UploadFile : IConsoleCommand return; } + var path = new ResourcePath(args[0]).ToRelativePath(); + var dialog = IoCManager.Resolve(); - var filters = new FileDialogFilters(new FileDialogFilters.Group("*")); + var filters = new FileDialogFilters(new FileDialogFilters.Group(path.Extension)); await using var file = await dialog.OpenFile(filters); if (file == null) @@ -54,7 +56,7 @@ public sealed class UploadFile : IConsoleCommand var netManager = IoCManager.Resolve(); var msg = netManager.CreateNetMessage(); - msg.RelativePath = new ResourcePath(args[0]).ToRelativePath(); + msg.RelativePath = path; msg.Data = data; netManager.ClientSendMessage(msg);