File Size

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
FerCastro
Posts: 47
Joined: Mon 26 Jun 2006 17:32
Location: México City
Contact:

File Size

Post by FerCastro » Wed 12 May 2010 23:03

Hello friends,

I have been trying the Securebridge and i need to know how to retrieve the size attrib from a file allocated in the SFTP server

I am doing something like this:

Code: Select all

Attrs := TScSFTPFileAttributes.Create;
    Handle := ScSFTPClient.OpenFile(GetRootDir + slArchivos[nCicloArchivos], [foRead], Attrs);
nTamServer := Attrs.Size;

Thanks, and best regards

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 13 May 2010 08:53

To get the file size you should use the RetrieveAttributes or RetrieveAttributesByHandle method, like this:

Code: Select all

  Handle := ScSFTPClient.OpenFile(GetRootDir + slArchivos[nCicloArchivos], [foRead]); 
  Attrs := TScSFTPFileAttributes.Create; 
  ScSFTPClient.RetrieveAttributesByHandle(Attrs, Handle);
  FielSize := Attrs.Size; 

Post Reply