Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listening in on HTTP data transfer to create 'progress bar' 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
If by some stroke of luck I manage to upload very large files via the HTTP MIME encoded method.

How would I set an event or listener to produce a progress bar meter with upload progress?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Looks like, to me at least, you are looking for a full upload solution - I saw your posting in the ASP forum as well.

If you have the money to spend, (and it's only $200 USD), I recommend ASPUPLOAD from persits software. Used it many times before and it works without fail everytime.

Also, this is assuming you are on an IIS platform, and since you did post in the ASP forum, my guess is that you are using IIS/Windows or are one of the few out there that is running ASP on Apache.


It has a progress bar built into it...and can support files up to 2GB in size.





--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Hi

What a "tricky" solution. The upload with progress bar opens a pop-up window where the HTML document is reloaded each second though [tt]meta http-equiv="Refresh"[/tt] tag. So it flickers once each second. And downloads 2.25 Kb HTML document each second. In 8 minutes of upload it will sum 1 Mb HTML document downloaded just for the progress bar. Nice.

( Hmm... I should stop criticizing vicvirk's suggestions. )


Feherke.
 
How do you get the file size before the upload starts?

I don't see how you can create a progress meter if you don't know how big the file is to start with, to then check how much has been uploaded.

I'm also not sure how you check this either...

As I understand the way the form POST method works,

The script in the 'Action' part isn't run untill the file has been uploaded to the server, is this correct?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Hi

1DMF said:
I don't see how you can create a progress meter if you don't know how big the file is to start with
I would say, make it 250 pixel wide.

Really.

There is no way for the JavaScript alone to find out when and how much to step the progress indicator.

As I mentioned before, the progress information will have to come from the server side.

So before starting the upload, you will only have to draw an empty progress bar. I would say, make it 250 pixel wide.

1DMF said:
The script in the 'Action' part isn't run untill the file has been uploaded to the server, is this correct?
According to the usual processing of a HTTP request, yes. But this kind of uploads are tricked abit. No proper idea how. Uber Uploader has a tiny diagram too in its documentation, I will read it someday...

Feherke.
 
Moving an image about with JS and CSS to display the progress meter is a sinch, I can do that bit.

What I don't understand is where I get the values from to do the maths and change the image display.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Man if that uber uploader works on my system, I could kiss you [love]

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
hmm, can't intergrate it into my members extranet :-(

this demo will only run on specific folder paths and open to joe public!

Dang

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
cracked it, got it uploading, just got to embed my 'log checker' to ensure only logged in members can use it and should be good to go.

Thanks Feherke, much apreciated

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top