Results 1 to 16 of 16

Thread: Upload Status

  1. #1

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Ok i've been given several suggestions on how to go about doing this, the best one was to get the filelen and use it as the rate for the progress bar. But that has it's problems. What if the person is on a T1 and another person is on a 33.6. But the status bar will move the same for both. Is there a way to measure upload speeds? or at least know when an upload is done?
    Plz help, Thank you,
    D!m

  2. #2
    Guest
    You could just do:
    Code:
    For i = 0 to 100
    Progressbar1.value = i
    'your code
    Next i
    Or you could do:
    Code:
    Function timeout(interval)
    Current = Timer
    Do While Timer - Current < Val(interval)
    DoEvents
    Loop
    End Function
    
    Progressbar1.Value = 5
    timeout .1
    Progressbar1.Value = 10
    timeout .1
    Progressbar1.Value = 10
    timeout .1
    Progressbar1.Value = 15
    timeout .1
    Progressbar1.Value = 20
    timeout .1
    Progressbar1.Value = 25
    timeout .1
    Progressbar1.Value = 30
    timeout .1
    .
    .
    .
    .
    .
    Progressbar1.Value = 100
    timeout .1
    'you can do this as many times as you want and put your code in to.
    Or:
    Code:
    Do: Doevents
    Progressbar1.value = Progressbar1 + 2 'or how much you want to add by
    'your code
    Loop Until Progressbar1.value = 100

  3. #3

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    I'm sorry but that code just didn't make alot of sense to me, can you plz explain it.
    Just to make sure you understand what i want (basicly...an upload status bar)

    Thanx,
    D!m

  4. #4
    Guest
    I understand what you want to do.
    Practice with the codes I gave you. Open a completely new form. Just place a Progressbar on the form. And put the complete codes, which I have commented.

    Code:
    For i = 0 to 100 'count to 100
    Progressbar1.value = i 'make progressbar status count from 0 to 100
    'your code
    Next i 'loop it until you hit 100
    Code:
    Function timeout(interval)
    'This code slows down the progress
    Current = Timer
    Do While Timer - Current < Val(interval)
    DoEvents
    Loop
    End Function
    
    Progressbar1.Value = 0 'Progress bar status = 0
    timeout .1 'timeout
    Progressbar1.Value = 1 'Progress bar status = 1
    timeout .1 'timeout
    Progressbar1.Value = 2 'Progress bar status = 2
    timeout .1 'timeout
    Progressbar1.Value = 3 'Progress bar status = 3
    timeout .1 'timeout
    Progressbar1.Value = 4 'Progress bar status = 4
    timeout .1 'timeout
    Progressbar1.Value = 5 'Progress bar status = 5
    timeout .1 'timeout
    Progressbar1.Value = 10 'Progress bar status = 10
    timeout .1 'etc.
    Progressbar1.Value = 10 'etc.
    timeout .1 'etc.
    Progressbar1.Value = 15 'etc.
    timeout .1
    Progressbar1.Value = 20
    timeout .1
    Progressbar1.Value = 25
    timeout .1
    Progressbar1.Value = 30
    timeout .1
    .
    .
    .
    .
    .
    Progressbar1.Value = 100
    timeout .1
    'you can do this as many times as you want and put your code in to.
    Code:
    Do: Doevents 'Start the Do code ;] DoEvents is to stop any freezing
    Progressbar1.value = Progressbar1 + 2 'or how much you want to add by 'count by 2s
    'your code
    Loop Until Progressbar1.value = 100 'loop by 2s until progressbar equals 100
    It shouldn't be so hard. Just copy the code in the form and it should all work, as long as you have a progressbar on the form .

  5. #5

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    But see if i have my code in between the bar code, then i keep on reconnecting to the ftp as the file is being uploaded. B/c i have one button that connects/uploads/activate bar

  6. #6

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    lol and it also uploads the files over and over and over. =)

  7. #7
    Guest
    Yeah, I realized that .

    So than just use the

    Progressbar1.Value = 5
    timeout .1
    Progressbar1.Value = 10
    timeout .1
    Progressbar1.Value = 15

    code.

    Or if you can wait an hour or probably less than that ;]...than I can come up with something else.

    It'll be like that Filelen one, but a little different.

    ....[works on it]....

  8. #8

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Matthew,
    you have been a GREAT help, but i figured out how to do it. I can put a label and keep on chenging it's caption as the events occur. =). Or even put a status bar at the end of the code and that will also show the user that the upload finished. Thank you for your help.
    If you are willing, i would like to ask you another question. I'm opening a browser with a url that is specified by a string, so i have...
    <code>
    Shell (url)
    </code>

    but the problem is, i don't want the user to see the browser windowm open.
    I also tried using the "MyIE" way by opening an IE window. But that will cause problems if the user has netscape.

    Do you know how i can open the url behind the users back.

    Thank you,
    D!m

  9. #9
    Guest
    Ok, I think this might work:

    Code:
    b = FileLen("C:\Command.com") / 8000
    If b = 0 Then b = 1
    b2 = 100 / b
    b3 = b2
    
    'lil code here
    
    If b3 < 100 Then
    ProgressBar1.Value = b3
    timeout 0.0000001
    End If
    b3 = b3 + b2
    
    'the rest of the code here
    
    ProgressBar1.Value = b3
    timeout 0.0000001
    ProgressBar1.Value = 100

  10. #10
    Member
    Join Date
    Jun 2000
    Location
    Gainesville, Ga
    Posts
    50

    Thumbs up Better Matthew

    That looks better and shorter to me.

    I hope my comments aren't offensive.
    I think you are brilliant, even at 15 1/2.
    Scott Cato
    VB6s

  11. #11
    Guest
    Code:
    vbHide	0	Window is hidden and focus is passed to the hidden window.
    
    Example:
    Address$ = "http://www.site.com"
    Shell("Start.exe " & Address$, vbHide)
    Code:
    Public Const SW_SHOWNORMAL = 1
    Public Const SW_ShowMinimized = 2
    Public Const SW_SHOWMAXIMIZED = 3
    Public Const SW_Hide = 0
    Public Const SW_MAX = 10
    Public Const SW_MAXIMIZE = 3
    Public Const SW_MINIMIZE = 6
    Public Const SW_NORMAL = 1
    
    Open Default Browser
    
    Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    
    a = ShellExecute(Me.hwnd, vbNullString, "http://www.site.com", vbNullString, "c:\", SW_Hide)

    Hehe..I'm gonna be 16 soon in about 4 months ;].



    [Edited by Matthew Gates on 07-09-2000 at 12:13 AM]

  12. #12

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Thanx alot, that will help me alot.
    You've been a great help, and now i know who to go to if i need more help.

    Thanx,
    D!m

  13. #13
    Guest
    Originally posted by Dim
    Matthew,
    you have been a GREAT help, but i figured out how to do it. I can put a label and keep on chenging it's caption as the events occur. =). Or even put a status bar at the end of the code and that will also show the user that the upload finished.
    That is quite what this code does:

    Code:
    Progressbar1.Value = 5
    timeout .1
    'do a little
    Progressbar1.Value = 10
    timeout .1
    'do a lil more
    Progressbar1.Value = 15
    timeout .1
    'some more?
    Progressbar1.Value = 20
    timeout .1
    'getting lazy?

  14. #14

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Yup,
    With that out of the way, i'm finaly finished my project and want to thank all that helped. Esp..Matthew and Maayan.
    Now i'll try to return the favot by helping as many ppl as possible on vbhelp.com and here.

    Laterz,
    D!m
    Dim

  15. #15
    Guest
    Can I take a look at the program?

    Email it to me at [email protected] if you want.

    Thank you.

  16. #16

    Thread Starter
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Umm...i'm not sure if i can release it yet. It *should* be available on calgarymbe.com fairy soon.
    It just basicly connects to a private ftp, sends user info to the administration by a url which is formed by combining several variables collected by the gui and allows the user to upload files to the ftp. I dun think it would be much use to you =).
    Dim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width