Pascal (Lazarus/Delphi)
Pascal (Lazarus/Delphi)
FTP Uncommon Compatibility Options
See more FTP Examples
Demonstrates the UncommonOptions property, a comma-separated list of compatibility options for uncommon platform or server requirements. The default is empty and should normally remain empty.
Background: This is a catch-all for narrow workarounds that do not warrant their own properties — behaviors needed only by a particular server or platform quirk. Most applications never set it. When you do, it is to satisfy a specific documented requirement, and the exact keyword matters, so consult the reference list rather than guessing.
Chilkat Pascal (Lazarus/Delphi) Downloads
program ChilkatDemo;
// Demonstrates using the Chilkat Pascal wrapper via the C bridge DLL.
// Builds as a console application under Lazarus (FPC) or Delphi.
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
SysUtils,
CkDllLoader,
Chilkat.Ftp2;
// ---------------------------------------------------------------------------
procedure RunDemo;
var
success: Boolean;
ftp: TFtp2;
begin
success := False;
ftp := TFtp2.Create;
ftp.Hostname := 'ftp.example.com';
ftp.Username := 'myFtpLogin';
// Normally you would not hard-code the password in source. You should instead obtain it
// from an interactive prompt, environment variable, or a secrets vault.
ftp.Password := 'myPassword';
// UncommonOptions is a comma-separated list of compatibility options for uncommon platform or
// server requirements. The default is empty and should normally remain empty; set a documented
// keyword only to work around a specific server or platform quirk.
ftp.UncommonOptions := 'SomeDocumentedKeyword';
success := ftp.Connect();
if (success = False) then
begin
WriteLn(ftp.LastErrorText);
Exit;
end;
WriteLn('Connected.');
success := ftp.Disconnect();
if (success = False) then
begin
WriteLn(ftp.LastErrorText);
Exit;
end;
ftp.Free;
end;
// ---------------------------------------------------------------------------
begin
try
RunDemo;
except
on E: Exception do
WriteLn('Unhandled exception: ', E.ClassName, ': ', E.Message);
end;
WriteLn;
{$IFDEF MSWINDOWS}
WriteLn('Press Enter to exit...');
ReadLn;
{$ENDIF}
end.