FXP transfer and progress monitoring

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
JimM
Posts: 9
Joined: Mon Mar 23, 2009 11:42 am

FXP transfer and progress monitoring

Post by JimM » Tue Mar 24, 2009 9:26 am

This follows on from a post I read in the pre-sales forum..

I would like to monitor progress of fxp transfers by the suggested route of monitoring the destination file size periodically (this being the only way to do it?).

When I start the FXPFile method, then it blocks till completed, so I have put that into a background worker thread (I'm using c# vs2008).

If I want to monitor progress, would I then start a new connection to the destination ftp server in my main thread and send a destination file size request via the GetFileSize method?

How would I then get the result as it's going to take some time? Do I have to check the .LastFileSize periodically, or is there an event I can look for?

Apologies if these are basic questions!

Jim

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: FXP transfer and progress monitoring

Post by mb » Tue Mar 24, 2009 10:05 am

Hello ..

Yes that's exactly what you would need to do: Open an extra connection to the destination and use the GetFileSize method periodically. The result of the GetFileSize method is saved in the LastFileSize property.

Regards,
Mat

JimM
Posts: 9
Joined: Mon Mar 23, 2009 11:42 am

Re: FXP transfer and progress monitoring

Post by JimM » Tue Mar 24, 2009 10:52 am

Hello ..

Yes that's exactly what you would need to do: Open an extra connection to the destination and use the GetFileSize method periodically. The result of the GetFileSize method is saved in the LastFileSize property.

Regards,
Mat

So, does GetFileSize block until it gets a filesize result from the server? - (presumably with a timeout if it doesn't get an answer?)

Is there an asynchronous way of getting the file size?

Jim

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: FXP transfer and progress monitoring

Post by mb » Tue Mar 24, 2009 11:16 am

All the functions are blocking. But GetFileSize() is fast and you get the result immediately.

Regards,
Mat

Post Reply