Changing access right to file

Jun 25, 2014 at 9:04 AM
How to change rights to file on the server. I use the Execute but I get error: CHMOD not understood
if (!(reply = conn.Execute("chmod 666 file.txt")).Success)
{
    throw new FtpCommandException(reply);
}
Coordinator
Jun 30, 2014 at 4:18 AM
Edited Jul 2, 2014 at 8:02 PM
There's already a set of methods for doing this. You're missing the SITE command (chmod is not a native FTP command). That said, it doesn't mean the server will support chmod but assuming it does the provided methods in FTP client should work fine. If you still wanted to do it with the Execute() method your code would need to look something like this:
if (!(reply = conn.Execute("SITE chmod 666 file.txt")).Success)