Issue
How do I change the permissions of a file using TidFTP in Delphi?
with IdFTP1 do
begin
try
Connect;
ChangeDir(FTPDiretorio);
Put(FArquivo, NomeOnline);
chmod(' ');//640 HOW??????????????
Disconnect;
finally
FreeAndNil(IdFTP1);
end;
end;
Solution
CHMOD
is not a standard FTP command. Some FTP servers implement it as a custom command, and others do not implement it at all. As such, you have to use the TIdFTP.Site()
method to send it, on FTP servers you know support it, eg:
IdFTP.Site('CHMOD 640 filename');
Answered By - Remy Lebeau Answer Checked By - David Marino (WPSolving Volunteer)