EldoS | Feel safer!

Software components for data protection, secure storage and transfer

how to determine if a file is completely uploaded?

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 02/10/2009 13:31:24
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12


I want to know if there is a method to determine if a file is completely uploaded. I write a function:
public bool isFileUpdloaded(string localPath, string remotePath)
if (Client.Active && File.Exists(localPath) && Client.FileExists(remotePath))
FileInfo fi = new FileInfo(localPath);
TElSftpFileAttributes fat = new TElSftpFileAttributes();
Client.RequestAttributes(remotePath, false, fat);
if (fi.Length == fat.Size)
return true;
return false;

I don't know IO.FileInfo.Length has the same value as TElSftpFileAttributes.size?

Posted: 02/10/2009 13:46:08
by Eugene Mayevski (Team)

You need to set fat.IncludedAttributes to specify that you are requesting size.

Sincerely yours
Eugene Mayevski
Posted: 02/10/2009 14:19:18
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

just add:

fat.IncludedAttributes = SBSftpCommon.__Global.saASize;

thank you
Posted: 02/10/2009 14:29:39
by Eugene Mayevski (Team)

Something like this

Sincerely yours
Eugene Mayevski



Topic viewed 1427 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!