Monitor File Transfer 
Author Message
 Monitor File Transfer

I'm trying to display percentage of file (or files) copied from one
directory to another via a progress bar.
My logic is this...
Once I gather the size of the files all I need to do is monitor the
copying process to know how to increment my progress bar.

Can anyone help with this?  As always its greatly appreciated.

Joe Conaty



Wed, 27 Jul 2005 00:22:44 GMT  
 Monitor File Transfer
Yep:

Add a progress bar to a form, scale it from o to the amount of bytes:

Progressbar1.min = 0
Progressbar.max = filesize

'transfer code goes here

Do While X <> amountofbytes
    Application.DoEvents
    X = current bytes transfered
   Progressbar1.Value = X
Loop

MSGBOX "Transfer has been completed."

hth


Quote:
> I'm trying to display percentage of file (or files) copied from one
> directory to another via a progress bar.
> My logic is this...
> Once I gather the size of the files all I need to do is monitor the
> copying process to know how to increment my progress bar.

> Can anyone help with this?  As always its greatly appreciated.

> Joe Conaty



Wed, 27 Jul 2005 01:06:29 GMT  
 Monitor File Transfer

Quote:
> I'm trying to display percentage of file (or files) copied from one
> directory to another via a progress bar.
> My logic is this...
> Once I gather the size of the files all I need to do is monitor the
> copying process to know how to increment my progress bar.

> Can anyone help with this?  As always its greatly appreciated.

> Joe Conaty

You mean files copied using a function that has no callback?

Nick.



Thu, 28 Jul 2005 01:13:05 GMT  
 Monitor File Transfer
Hello,

Quote:

> You mean files copied using a function that has no callback?

why no callback ? Callbacks easy to programm with a Delegate.

Regards

Holger



Thu, 28 Jul 2005 06:06:35 GMT  
 Monitor File Transfer

Quote:
> why no callback ? Callbacks easy to programm with a Delegate.

what?  I was asking "Joseph" if he was trying to monitor the file transfer
of a function that has no callback.  I.e, if he was using a file system
object that had no call back then is he simply wanting to retrieve the
filesize until it is the size of the original?  I'm not quite sure where
your coming from.

Nick.



Thu, 28 Jul 2005 06:12:06 GMT  
 Monitor File Transfer
Thanks for the replies.  To break it down more simply...

I have a diectory on a network drive that holds all of my project files.
I am building an "Auto update" application that goes out and retrieves
these files when ever they are newer than the files that reside on the
client machine.  Will the files are being transfered from the network
drive to the client machine I want to disply the progress.

1. I cant find the size of the file using the FileSystemObject... How do
i find the size of the file?
(My theory here is that I could continuesly monitor the file size and
gage it that way)

2. Is there a way to catch the bytes being transferred AS they BEING
transferred? (This would seam to be the most optimal way to do it)

Nick had mentioned a delegete... Could you elaborate please?

I have seen many unclear examples out there.  I am pretty clear on
setting the progress bar, I just dont know how to monitor the file
transfer progress.  I appreciate very much if you could give me an idea
on how this is done.

Many thanks in advance

Joe Conaty

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 29 Jul 2005 02:55:04 GMT  
 Monitor File Transfer
Thanks Richard

Looks easy enough.  Before I jump in, will using the FileSystemObect
Methods work with this?  How does the loop know the amount being moved?
It doesnt appear to be asynchronise.  I'm sorry for being lame.
Sometimes I over think to default.

Can you please elaborate a little more on your example

Sincerely appreciated

Joe Conaty

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 29 Jul 2005 02:55:05 GMT  
 Monitor File Transfer
Hi Joe,

    I had a similar problem before when programming an app in VB6, I wanted
to display the progress of moving, copying or deleting a file as i wanted to
act the second it had finished, and I found that sometimes my app was
proceeding before the operation was complete, thus causing a file access
issue.

    If you simply want to display to progress as a niceity then try using
the API "SHFileOperation".  This enables you to display the standard Windows
'file operation progress' dialog.

    Other than that you may want to try using a FileSystemWatcher object.
With this you can get it to watch the destination path and notify you of
filename / filesize changes.  I presume this would probably be the easiest
and fastest way as I think maybe constantly polling the FSO object may slow
your application down a little and cause other problems round the corner.

    Copy the below address into your internet explorer address bar and youll
get the information on the FileSystemWatcher object.

ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemIOFileSystemWatcherMembers
Topic.htm

    If you still have any issues ill put a small example together for you.

Nick.



Fri, 29 Jul 2005 07:02:11 GMT  
 Monitor File Transfer
Thanks a bunch!!

I will try that.  I will let you know how I turn out

Regards

-j

Joe Conaty

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 30 Jul 2005 08:23:45 GMT  
 Monitor File Transfer
How do we determine how many bytes have been downloaded? I'm trying to
download a file from an ftp site? I can get the size of the file ok, but
current bytes transferrred... sorry I coulndn't get it... Can you please
tell..?



Quote:
> Yep:

> Add a progress bar to a form, scale it from o to the amount of bytes:

> Progressbar1.min = 0
> Progressbar.max = filesize

> 'transfer code goes here

> Do While X <> amountofbytes
>     Application.DoEvents
>     X = current bytes transfered
>    Progressbar1.Value = X
> Loop

> MSGBOX "Transfer has been completed."

> hth



> > I'm trying to display percentage of file (or files) copied from one
> > directory to another via a progress bar.
> > My logic is this...
> > Once I gather the size of the files all I need to do is monitor the
> > copying process to know how to increment my progress bar.

> > Can anyone help with this?  As always its greatly appreciated.

> > Joe Conaty



Wed, 27 Jul 2005 20:24:17 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Monitoring File Transfer

2. Monitoring Data Transfer of Internet Transfer Contol

3. Network: Monitoring data-transfer (Repost)

4. How to transfer a file greater than 64Kb w/ internet transfer ctrl

5. HOWTO: Securely transfer a file using the Internet Transfer Control

6. api functions-monitoring files/files being copied

7. Open File for File Transfer

8. GUI programmed on 14inch monitor is different on 19inch Monitor

9. Performance Monitor , eh Monitor

10. Usinig 2 monitors: IDE problem on secondary monitor

11. Monitoring file use

12. How to : Monitor File Access

 

 
Powered by phpBB® Forum Software