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.
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.