views:

132

answers:

2

I want to use progress bar to show file upload progress. I'm currently using the following code

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.progressbar.min.js"></script>

$(document).ready(function() {
$("#spaceused1").progressBar();
});

HTML:

<span class="progressBar" id="spaceused1">25%</span>

<a href="#" onclick="$('#spaceused1').progressBar(20);">20</a>
<a href="#" onclick="$('#spaceused1').progressBar(40);">40</a>
<a href="#" onclick="$('#spaceused1').progressBar(80);">80</a>

It works fine when i click on the above links. But now how can i use to show the file upload progress?

Please help me out.

A: 

You'll need to use some kind of Flash uploader, as this is the only way to get progress notifications from JavaScript. There's a good library for this called SWFUpload, for which there is a jQuery wrapper here.

Will Vousden
A: 

you will need to use something that has the capability of assessing how much of a file has been uploaded already - the flash solution is a possibility but perl is also capable.

uber uploader

ToonMariner
Ok it means i'll have to use uber uploader for this. Now tell me if i have post large data to other page, what should i use to show progress of data posted. In other words i'm running a php script which generates the output in for loop when the data is posted to that. This proces takes around 2 min. Now tell which progress bar should i use for that?
fawad
with uber uploader you actually post your data to the perl script - it then uses ajax calls to get the amount uploaded. you can then set the perl script to redirect on success.
ToonMariner