开发者

jquery progress bar to show upload file progress

I want to use progress bar to show file upload progress. I'm currently using the following cod开发者_如何学JAVAe

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜