I
I
IA-NE-ROBOT2021-04-25 09:46:56
FTP
IA-NE-ROBOT, 2021-04-25 09:46:56

How to change folder attributes via ftp using c#?

tried only

request.Method = "CHMOD 777 " + dirname;

method is not supported.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ayazer, 2021-04-25
@IA-NE-ROBOT

chmod is not a standard ftp command, therefore its support depends solely on the desire of the ftp server developers. judging by the "method is not supported" - you once again have a situation when it was not implemented.
You can see the list of available commands through help. For example, for filezilla:

Command:	help
Response:	214-The following commands are recognized:
Response:	   ABOR   ADAT   ALLO   APPE   AUTH   CDUP   CLNT   CWD 
Response:	   DELE   EPRT   EPSV   FEAT   HASH   HELP   LIST   MDTM
Response:	   MFMT   MKD    MLSD   MLST   MODE   NLST   NOOP   NOP 
Response:	   OPTS   PASS   PASV   PBSZ   PORT   PROT   PWD    QUIT
Response:	   REST   RETR   RMD    RNFR   RNTO   SITE   SIZE   STOR
Response:	   STRU   SYST   TYPE   USER   XCUP   XCWD   XMKD   XPWD
Response:	   XRMD
Response:	214 Have a nice day.

Well, in this case, you won’t change it in any way. ftp server can't do that. Searching for other nuget packages with other clients won't help. the reason is how the ftp server itself implements the protocol.
UPD: judging by RFC1123 - the expected command should be SITE CHMOD 777 FILENAME, the rest of the options are a step away from the standard

V
Vladimir Korotenko, 2021-04-25
@firedragon

The simplest method is to supply a nuget package with this functionality. Look for them there are many

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question