Get FTP status and download progress - WeOnlyDo Discussion board

Get FTP status and download progress (wodFtpDLX / wodFtpDLX.NET)

by Michael, Saturday, February 27, 2010, 17:22 (5162 days ago)

Hello,

I'm trying to create a STATIC list of the CURRENT status of the FTP server. I want to list:

1. Users/connections/states
2. Download/Upload progress for the CURRENT connections

The FtpUsers and FTPUser Objects can list almost everything - but not the current download progress. Unfortunately, '.BytesDownload' and '.BytesUpload' properties are accumulated bytes for the whole session - not the current file activity.

IwodFTPDNotify_Progress event holds the values I'm looking for, but these values are only accessible from the event, not as a property.

Any tips are appreciated!

Regards,
Michael

Re: Get FTP status and download progress

by woddrazen, Saturday, February 27, 2010, 20:33 (5162 days ago) @ Michael

Hi Michael,


Why don't you put Total value from Progress Even in some variable and use it like that? Progress Event Total value hold total size of file that will be transferred.

Here is example you should try inside Progress Event:
[code] If Position = Total Then
transfer_value = Total
End If[/code]
You can also use User.Tag instead transfer_value if aren't already using it for something else.

Let us know ho wit goes.


Regards,
Drazen

Re: Get FTP status and download progress

by Michael, Sunday, February 28, 2010, 07:14 (5162 days ago) @ woddrazen

Thanks, I will give it a try

On the other hand, it will be tricky to have the event variable syncronized in a smart way if users connect/disconnect. For example, user 2 is downloading while user 1 is disconnecting.

If possible I would like (perhaps in future release) to have properties 'DownloadedBytes' & 'DownloadBytesTotal'.

Regards,
Michael

Re: Get FTP status and download progress

by woddrazen, Sunday, February 28, 2010, 13:09 (5161 days ago) @ Michael

Michael,


Why don't you then use User.Tag Property? Tag Property value will be valid as long as user is connected to the server.

Can you try something like that and let us know how it goes?


Drazen

Re: Get FTP status and download progress

by Michael, Sunday, February 28, 2010, 18:49 (5161 days ago) @ woddrazen

Smart!

Yes, using the tag property to store the current file progress seems to work. I haven't tested with 64bit sizes but the tag is a variant so it shouldn't be a problem.

Thanks!

Michael