Add OPTS command
This commit is contained in:
@@ -18,6 +18,7 @@ namespace DearFTP.Connection.Commands
|
||||
new ListCommand(),
|
||||
new ListMachineCommand(),
|
||||
new MakeDirectoryCommand(),
|
||||
new OptionsCommand(),
|
||||
new ParentDirectoryCommand(),
|
||||
new PassiveCommand(),
|
||||
new PwdCommand(),
|
||||
|
||||
25
DearFTP/Connection/Commands/OptionsCommand.cs
Normal file
25
DearFTP/Connection/Commands/OptionsCommand.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DearFTP.Connection.Commands
|
||||
{
|
||||
class OptionsCommand : ICommand
|
||||
{
|
||||
public string[] Aliases { get; } = new string[]
|
||||
{
|
||||
"OPTS"
|
||||
};
|
||||
|
||||
public void Execute(Session session, FtpStream stream, string alias, string argument)
|
||||
{
|
||||
if (argument.ToUpper().Contains("UTF"))
|
||||
{
|
||||
stream.Send(ResponseCode.OK, "UTF8 supported on this server.");
|
||||
return;
|
||||
}
|
||||
|
||||
stream.Send(ResponseCode.ArgumentsError, "Requested option not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user