ibec_ftp_FileSize

Description

ibec_ftp_FileSizereturns the size of a file in Bytes.

Syntax

 function ibec_ftp_FileSize(FTPSession : variant; FileName : string) : variant;

ibec_ftp_FileSize returns the size in bytes of a file specified by the FileName variable. This function returns NULL if the specified file doesn't exist or in case of any another error.

Example

 FTPSession = ibec_ftp_OpenSession('HostName=myftpserver.com; UserName=me; 
                    Password=mysecret');
    try 
      if (ibec_ftp_Connect(FTPSession)) then
      begin
        if (ibec_ftp_ChangeDir(FTPSession, '\uploads')) then
        begin
          FileSize = ibec_ftp_FileSize(FTPSession, 'db.fdb'); 
          if (FileSize is not null) then
            ibec_ShowMessage('File size is ' || FileSize || ' bytes');
        end;
        ibec_ftp_Disconnect(FTPSession);
      end;
    finally
      ibec_ftp_CloseSession(FTPSession); 
    end; 

See also:
ibec_ftp_FileDate
ibec_ftp examples

back to top of page
<< ibec_ftp_DeleteFile | IBEBlock | ibec_ftp_FileDate >>