| Dart Home | PowerTCP Web for ActiveX | Custom Development | Reply | PowerTCP Web for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Web for ActiveX Topic: get file with http |
| enibris From: fr, France Posts: 16 Member Since: 04/08/06 |
posted May 4, 2006 10:23 AM I user http to get file And use progress bar Public Function HttpFile(Url As String, File As String) As Boolean HttpFile = False Dim Headers As New DartStrings On Error GoTo OnError MDIForm1.Http1.Timeout = 2 * 1000 MDIForm1.Http1.Cache = False MDIForm1.Http1.Url = "http://" & DNS & "/" & Url MDIForm1.Http1.Get File, Headers HttpFile = True Exit Function OnError: If Err <> 0 Then Call Erreur.ErreurOut("HttpFile error:" & Err & " " & Err.Description) End Function Private Sub Http1_Progress(ByVal Count As Long, ByVal Size As Long) If Size > 0 And Not (Count >= Size) Then PB.Visible = True Pourcent.Visible = True Bytes.Visible = True PB.Min = 0 PB.Max = Size PB.value = Count Bytes.Caption = Int(Count / 1000) & "/" & Int(Size / 1000) & " Kb" Pourcent.Caption = Int((Count / Size) * 100) & " %" 'affichage du % du telechargement End If End Sub I download file, in the middle , i switch off my router, http said ok (200) every time and progress bar progress Why ? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted May 4, 2006 2:56 PM I'm sorry, but I am not able to duplicate the problem that you are describing. Using the PageFetch sample, I started dowloading a large file, then unplugged the network cable. As expected the progress bar immediately stopped and 20 seconds later I got a timeout error. |
| enibris From: fr, France Posts: 16 Member Since: 04/08/06 |
posted May 5, 2006 7:53 AM I'm sorry for you,i use you vb application page fetch I download file of 4mb When i unplugged network cable, i see in debug progress count non stop and stop after 25s, no immediatly |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted May 5, 2006 10:56 AM Are you running any kind of proxy server? The web control uses the same DLL (WININET.DLL) that IE uses. It's possible that WININET has already gotten a bunch of data before the connection was released and it delivered it to us afterwards. |
| enibris From: fr, France Posts: 16 Member Since: 04/08/06 |
posted May 5, 2006 12:03 PM No proxy |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted May 5, 2006 12:29 PM It's still possible that wininet is buffering data. At least that's the best explanation I can think of. |
| Reply | PowerTCP Web for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|