Topic "how to show progress of downloading file"

Author Message
lduczmal
[View user's profile]

Joined: 2013-01-30
Posts: 7
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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
This request is being tracked already:
https://winscp.net/tracker/show_bug.cgi?id=818

I'm sending you an email with a development version of WinSCP to address you have used to register on this forum.
lduczmal
[View user's profile]

Joined: 2013-01-30
Posts: 7
Thank you very much!
Best regards
lduczmal
[View user's profile]

Joined: 2013-01-30
Posts: 7
Could you tell me how to use this new feature? Is there new event or new property of session object?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
See Session.FileTransferProgress
GToF
[View user's profile]
Donor
Joined: 2012-08-06
Posts: 4
prikryl 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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.
GToF
[View user's profile]
Donor
Joined: 2012-08-06
Posts: 4
Thx a lot !!!
lduczmal
[View user's profile]

Joined: 2013-01-30
Posts: 7
I can't find anything like filetransferprogress.
$session|get-member shows following members of $session object
Code:
   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;}   
GToF
[View user's profile]
Donor
Joined: 2012-08-06
Posts: 4
an example based on handled session :

instead of

Code:
session.FileTransferred += FileTransferred;


used

Code:
session.FileTransferProgress += FileTransferProgress;


and so used the code below :
Code:

        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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
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.
spyjamesbond0072003
[View user's profile]

Joined: 2013-01-15
Posts: 1
Location: VietNam
When I call
Code:
session.FileTransferProgress += FileTransferProgress;

I got
Code:
Session is already opened
exception. Please help
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
spyjamesbond0072003 wrote:
When I call
Code:
session.FileTransferProgress += FileTransferProgress;

I got
Code:
Session is already opened
exception. Please help

You have to assign the handler before calling Session.Open.
Sporge
[View user's profile]

Joined: 2012-12-06
Posts: 1
Location: South Africa
prikryl wrote:
This request is being tracked already:
https://winscp.net/tracker/show_bug.cgi?id=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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
Sporge wrote:
I am interested in the FileTransferProgress as well. Would you please provide me with the development version.

Sent.
_________________
Martin Prikryl
CoreyZ
[View user's profile]

Joined: 2013-03-28
Posts: 4
Oh please me too! I hope this becomes a standard piece soon. Very Happy
Great tool btw!
CoreyZ
[View user's profile]

Joined: 2013-03-28
Posts: 4
CoreyZ wrote:
Oh please me too! I hope this becomes a standard piece soon. Very Happy
Great tool btw!


Any chance you mind adding me to the tester list?
gjs
[View user's profile]

Joined: 2012-07-11
Posts: 10
This feature is included in 5.2 beta release available from the download page.
migges
[View user's profile]

Joined: 2013-05-13
Posts: 1
Location: Germany
Hi,

can someone show me an example in VB.NET?

I never really understood this EventHandler stuff :/
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
migges wrote:
can someone show me an example in VB.NET?

I never really understood this EventHandler stuff :/

See https://winscp.net/eng/docs/library_session_filetransferprogress#vbnet
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License