Bound uploadfile to the relative path's extension (#11120)

This commit is contained in:
Flipp Syder
2022-09-08 07:02:26 -07:00
committed by GitHub
parent b7c08238e4
commit ae8fe43529

View File

@@ -30,9 +30,11 @@ public sealed class UploadFile : IConsoleCommand
return;
}
var path = new ResourcePath(args[0]).ToRelativePath();
var dialog = IoCManager.Resolve<IFileDialogManager>();
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<INetManager>();
var msg = netManager.CreateNetMessage<NetworkResourceUploadMessage>();
msg.RelativePath = new ResourcePath(args[0]).ToRelativePath();
msg.RelativePath = path;
msg.Data = data;
netManager.ClientSendMessage(msg);