开发者

Crossbrowser Upload progress meter (without SWFUpload please)

开发者 https://www.devze.com 2023-02-20 15:22 出处:网络
Im trying to make a upload progress meter that works on ALL modern browsers in all operative systems (hence that I don\'t want to use SWFUpload, since all the demo pages fail in my computer, since I u

Im trying to make a upload progress meter that works on ALL modern browsers in all operative systems (hence that I don't want to use SWFUpload, since all the demo pages fail in my computer, since I use Ubuntu).

Could someone give me please a hint where to 开发者_Go百科look? I've googled the internet up and down without a solution...

Im running a server with PHP, but APC didnt work, apparently doesnt play nice with lightppd. Also I don't know Perl, so I'd rather not having to learn it for this.


I did this using ASP.NET not long ago. Basically, there's no pure HTML way to do it. What needs to be done, is to make changes on your server (in ASP.NET, I wrote an HttpModule to cache the current status of the upload - for PHP, Ruby, etc, there's likely similar methods to plug into).

Then on the client side - when a file was being uploaded, I made periodic ajax calls to the server to access the upload data that the server was caching. Then, using javascript, I would update whatever HTML progress bar.


You can see plUpload : http://www.plupload.com/


If you're using AJAX, you could go with this solution. And here are a few using jQuery.

0

精彩评论

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