ftp_list_files

 execute ibeblock(
    HostName variant,
    UserName variant,
    Pwd variant,
    RemoteDir variant = '\',
    Files 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_List(ftp, Files, FALSE);
       if (Res) then
         ibec_ShowMessage(ibec_ftp_GetData(ftp));
     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
<< ftp_upload_file | IBEBlock | ftp_folders >>