ftp_download_file

 execute ibeblock(
    HostName variant,
    UserName variant,
    Pwd variant,
    RemoteDir variant = '\',
    RemoteFileName variant,
    DownloadFileName variant,
    ShowLog boolean = TRUE)
 as
 begin
   ftp = ibec_ftp_OpenSession('');
   try
     ibec_ftp_SetProperty(ftp, 'HostName', HostName);
     ibec_ftp_SetProperty(ftp, 'UserName', UserName);
     ibec_ftp_SetProperty(ftp, 'Password', Pwd);

     --ibec_ftp_SetProperty(ftp, 'PassiveMode', FALSE);
     --ibec_ftp_SetProperty(ftp, 'TransferMode', 'ASCII');

     Res = ibec_ftp_Connect(ftp);

     if (Res) then
     begin
       ibec_ftp_ChangeDir(ftp, RemoteDir);
       Res = ibec_ftp_GetFile(ftp, RemoteFileName, DownloadFileName);
       if (Res) then
         ibec_ShowMessage('Success!');
     end

     if (ShowLog) then
       ibec_ShowMessage(ibec_ftp_GetProperty(ftp, 'SESSIONLOG'));
   finally
     ibec_ftp_CloseSession(ftp);
   end;
 end;

See also:
Functions for working with FTP servers

back to top of page
<< Disable and enable IBExpert features | IBEBlock | ftp_upload_file >>