Home Forums .NET libraries Xceed SFTP/FTP for .NET FileTransferStatus for sFTP

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21486 |

    Is there a FileTransferStatus type event for the sFTP functions?

    We sometimes have to download fairly large files from our vendor and it would be nice to be able to report some sort of progress to the user when that is occuring.

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Chad (had 785 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Chad,

    You can get the progress information with the FileSystemEvents.ByteProgression event.

       Documentation:
       http://doc.xceedsoft.com/products/XceedFileSystem/topic134.html
       http://doc.xceedsoft.com/products/XceedFileSystem/topic998.html

    For example, let’s say you are downloading a file from an SFtp server:

       FileSystemEvents events = new FileSystemEvents();
       events.ByteProgression += new ByteProgressionEventHandler( OnByteProgression );

       someSftpfile.CopyTo( events, null, destinationFolder, true );

       public static void OnByteProgression( object sender, ByteProgressionEventArgs e )
       {
          Console.WriteLine( “Processed {0} bytes of {1} on {2}.”,
                              e.CurrentFileBytes.Processed,
                              e.CurrentFileBytes.Total,
                              e.CurrentItem.Name );
       }

     

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 973 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.