Solved

ProgressBar for xmlHttpRequest

Posted on 2006-11-24
2
382 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now