开发者

File upload progress bar [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Upload Progress Bar in PHP

开发者_开发技巧

Can anyone suggest a good and easy way to include the file upload progress bar, while uploading a file. I know it would be a mix of javascript & php. Please suggest one


I like uploadify. Its very easy to implement and does the job perfectly.


http://valums.com/ajax-upload/

I chanced upon this recently and really liked it.


SWFUpload

SWFUpload is a JavaScript Library that wraps the Flash Player's upload function. It brings your uploads to the next level with Multiple File Selection, Upload Progress and Client-side File Size Checking.


You'll have to check the size of the part of the file wich is allready on the Server, then get it on the Client per Ajax where you can paint the progress bar. (Remember to check the size of the hole Data before, to calculate the percantage ;-) )


I don't believe this is possible utilizing ajax. The only time you can get the complete file size is after upload and by then it's too late. '

If you utilize a flash-based uploader however, it is possible.


all "ajaxy" looking solutions use an swf object to do the upload job. you can home-cook your progressbar if you have an op-code cacher like APC

Here is Martin Jansen blogging about Rasmus Lerdorf's simple upload code which in the end uses APC

http://martinjansen.com/2007/04/28/file-upload-progress-bars-with-php/

and a working example

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜