how to show progress of downloading file

Advertisement

lduczmal
Joined:
Posts:
7

how to show progress of downloading file

Hi,
Is it possible to display progress of downloading single file? I think about session.getfiles method. I'm working in Powershell v2
Best regards

Reply with quote

Advertisement

Advertisement

GToF
Donor
Joined:
Posts:
4

Re: how to show progress of downloading file

martin wrote:

...I'm sending you an email with a development version of WinSCP to address you have used to register on this forum.

Hi Mr prikryl and thx for the good work.

I m very interested in this developpement version; I m a donator but the nighty build only diffuse the .exe and *.com version of winscp.

is there a possibility to obtain the last developpement version too ?


Thx in advance.

Christophe T.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: how to show progress of downloading file

GToF wrote:

I m very interested in this developpement version; I m a donator but the nighty build only diffuse the .exe and *.com version of winscp.

is there a possibility to obtain the last developpement version too ?
I have sent you an email with a development version of WinSCP and the .NET assembly to address you have used to register on this forum.

Reply with quote

lduczmal
Joined:
Posts:
7

I can't find anything like filetransferprogress.
$session|get-member shows following members of $session object
   TypeName: WinSCP.Session

Name                          MemberType Definition                                                                                                                                           
----                          ---------- ----------                                                                                                                                           
Failed                        Event      WinSCP.FailedEventHandler Failed(System.Object, WinSCP.FailedEventArgs)                                                                              
FileTransferred               Event      WinSCP.FileTransferredEventHandler FileTransferred(System.Object, WinSCP.TransferEventArgs)                                                          
OutputDataReceived            Event      WinSCP.OutputDataReceivedEventHandler OutputDataReceived(System.Object, WinSCP.OutputDataReceivedEventArgs)                                          
Abort                         Method     void Abort()                                                                                                                                         
CreateDirectory               Method     void CreateDirectory(string path)                                                                                                                    
Dispose                       Method     void Dispose(), void IDisposable.Dispose()                                                                                                           
Equals                        Method     bool Equals(System.Object obj)                                                                                                                       
EscapeFileMask                Method     string EscapeFileMask(string fileMask)                                                                                                               
ExecuteCommand                Method     WinSCP.CommandExecutionResult ExecuteCommand(string command)                                                                                         
FileExists                    Method     bool FileExists(string path)                                                                                                                         
GetField                      Method     System.Reflection.FieldInfo IReflect.GetField(string name, System.Reflection.BindingFlags bindingAttr)                                               
GetFields                     Method     System.Reflection.FieldInfo[] IReflect.GetFields(System.Reflection.BindingFlags bindingAttr)                                                         
GetFileInfo                   Method     WinSCP.RemoteFileInfo GetFileInfo(string path)                                                                                                       
GetFiles                      Method     WinSCP.TransferOperationResult GetFiles(string remotePath, string localPath, bool remove, WinSCP.TransferOptions options)                            
GetHashCode                   Method     int GetHashCode()                                                                                                                                    
GetMember                     Method     System.Reflection.MemberInfo[] IReflect.GetMember(string name, System.Reflection.BindingFlags bindingAttr)                                           
GetMembers                    Method     System.Reflection.MemberInfo[] IReflect.GetMembers(System.Reflection.BindingFlags bindingAttr)                                                       
GetMethod                     Method     System.Reflection.MethodInfo IReflect.GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, type[] t...
GetMethods                    Method     System.Reflection.MethodInfo[] IReflect.GetMethods(System.Reflection.BindingFlags bindingAttr)                                                       
GetProperties                 Method     System.Reflection.PropertyInfo[] IReflect.GetProperties(System.Reflection.BindingFlags bindingAttr)                                                  
GetProperty                   Method     System.Reflection.PropertyInfo IReflect.GetProperty(string name, System.Reflection.BindingFlags bindingAttr), System.Reflection.PropertyInfo IRefl...
GetType                       Method     type GetType()                                                                                                                                       
InvokeMember                  Method     System.Object IReflect.InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target,...
ListDirectory                 Method     WinSCP.RemoteDirectoryInfo ListDirectory(string path)                                                                                                
MoveFile                      Method     void MoveFile(string sourcePath, string targetPath)                                                                                                  
Open                          Method     void Open(WinSCP.SessionOptions sessionOptions)                                                                                                      
PutFiles                      Method     WinSCP.TransferOperationResult PutFiles(string localPath, string remotePath, bool remove, WinSCP.TransferOptions options)                            
RemoveFiles                   Method     WinSCP.RemovalOperationResult RemoveFiles(string path)                                                                                               
SynchronizeDirectories        Method     WinSCP.SynchronizationResult SynchronizeDirectories(WinSCP.SynchronizationMode mode, string localPath, string remotePath, bool removeFiles, bool m...
ToString                      Method     string ToString()                                                                                                                                    
AdditionalExecutableArguments Property   string AdditionalExecutableArguments {get;set;}                                                                                                      
DebugLogPath                  Property   string DebugLogPath {get;set;}                                                                                                                       
DefaultConfiguration          Property   bool DefaultConfiguration {get;set;}                                                                                                                 
DisableVersionCheck           Property   bool DisableVersionCheck {get;set;}                                                                                                                  
ExecutablePath                Property   string ExecutablePath {get;set;}                                                                                                                     
IniFilePath                   Property   string IniFilePath {get;set;}                                                                                                                        
Opened                        Property   bool Opened {get;}                                                                                                                                   
Output                        Property   WinSCP.StringCollection Output {get;}                                                                                                                
ReconnectTime                 Property   timespan ReconnectTime {get;set;}                                                                                                                    
SessionLogPath                Property   string SessionLogPath {get;set;}                                                                                                                     
Timeout                       Property   timespan Timeout {get;set;}                                                                                                                          
UnderlyingSystemType          Property   type UnderlyingSystemType {get;}                                                                                                                     
XmlLogPath                    Property   string XmlLogPath {get;set;}   

Reply with quote

Advertisement

GToF
Donor
Joined:
Posts:
4

an example based on handled session :

instead of

session.FileTransferred += FileTransferred;

used

session.FileTransferProgress += FileTransferProgress;

and so used the code below :
        void FileTransferProgress(object sender, FileTransferProgressEventArgs e)
        {

            Console.WriteLine("file name: {0}", e.FileName);
            Console.WriteLine("directory: {0}", e.Directory);
            Console.WriteLine("File progress: {0}", Math.Truncate(e.FileProgress * 100).ToString());
            Console.WriteLine("Global progress: {0}", Math.Truncate(e.OverallProgress * 100).ToString());

        }

based on my C# example (adapted but not tested).
Last edited by GToF on 2013-02-24 16:38; edited 1 time in total

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

lduczmal wrote:

I can't find anything like filetransferprogress.
$session|get-member shows following members of $session object
Sorry, I have sent you a new version via email.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

spyjamesbond0072003 wrote:

When I call
session.FileTransferProgress += FileTransferProgress;
I got
Session is already opened
exception. Please help
You have to assign the handler before calling Session.Open.

Reply with quote

Advertisement

Sporge
Joined:
Posts:
1
Location:
South Africa

Re: how to show progress of downloading file

martin wrote:

This request is being tracked already:
https://winscp.net/tracker/818

I'm sending you an email with a development version of WinSCP to address you have used to register on this forum.

Good day Martin,

Thank you for a superb application.

I am interested in the FileTransferProgress as well. Would you please provide me with the development version.

Kind regards,
Sporge

Reply with quote

martin
Site Admin
martin avatar

Re: how to show progress of downloading file

Sporge wrote:

I am interested in the FileTransferProgress as well. Would you please provide me with the development version.
Sent.

Reply with quote

CoreyZ
Joined:
Posts:
4

CoreyZ wrote:

Oh please me too! I hope this becomes a standard piece soon. :D
Great tool btw!

Any chance you mind adding me to the tester list?

Reply with quote

Advertisement

migges
Joined:
Posts:
1
Location:
Germany

example VB.NET

Hi,

can someone show me an example in VB.NET?

I never really understood this EventHandler stuff :/

Reply with quote

Advertisement

You can post new topics in this forum