Solved

ProgressBar for xmlHttpRequest

Posted on 2006-11-24
2
406 Views
Last Modified: 2007-01-05
hello,

I have an activeX app which is used to upload and download files, the way is does this is by encoding and decoding the files into xml then using the xmlHttpRequest method in VB to and from asp pages on the server which encode/decode (depending on up or download) and save the faile back in its original state.

To get round the progressbar issue over http what I have done is calculate the file size , estimate the network speed then divide the file size by network speed, set a progressbar max value to the result and fire off a timer which runs until the progressbar reaches its max value.

This isnt too inaccurate but I can forsee future inaccuracies with larger / smaller files and varying internet speeds.

SO can anyone suggest a way or gettting the progress of a file transfer using the xmlHttpRequest object

e.g getBytesLoaded in action script?

many thanks.

 
0
Comment
Question by:wdhough
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 250 total points
ID: 18151068
The only problem you will have is correctly determining remaining time.

Your system will work perfectly for displaying progress, however, if you want to display time remaining, I suggest you simply take an average.

 dim startTime as date
 dim bytesTransfered as long
 dim eSec as long
 dim rate as long
 dim totalBytes as long


 startTime = now



 eSec = datediff("s",now,startTime)
 rate = bytesTransfered / eSec 'bytes per sec


Does that make sense?
0
 

Author Comment

by:wdhough
ID: 18157380
yeah wicked thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question