PDA

Click to See Complete Forum and Search --> : FTP Progress Bar


ChrisW
Jan 23rd, 2000, 12:24 PM
I have made a VB program that FTPs a single file to a server using the inet control. However, I need a way to show the progress of this file as it uploads because the file size is usually over 2 Mgs and I upload over a modem. How do I make a progress bar that will show how much has been transfered?

dj4
Jan 23rd, 2000, 12:42 PM
I'm using Progress Bar this way:

Public Sub FtpGetFile()

Form1.Inet.Execute , "GET " & GetFile & " " & App.Path & "\" & GetFile

FileTransfer

End Sub

Public Sub FileTransfer()

'ProgressBar Max Value = 35000
Form1.ProgressBar1.Value = 0.05

Do While Form1.Inet.StillExecuting

If Form1.ProgressBar1.Value < Form1.ProgressBar1.Max - 1 Then

Form1.ProgressBar1.Value = Form1.ProgressBar1.Value + 0.05

End If

DoEvents

Loop

Form1.ProgressBar1.Value = Form1.ProgressBar1.Max

End Sub

- Dj4

Jan 23rd, 2000, 10:57 PM
Simple awnser: You can't get that progressbar.

Hard awnser: it is possible to make your own upload routine, FTP opens a specific port and uploads the file to there(atleast it does so in binary mode.). When it is finished uploading it cloeses the port.

The way to make a progress bar is to make this yourself(This aint an easy thing to do).


------------------

Vincent van den Braken
EMail: azzmodan@azzmodan.demon.nl
ICQ: 15440110 (http://www.icq.com/15440110)
Homepage: http://www.azzmodan.demon.nl