1. Use of PHP founder Rasmus Lerdorf wrote the APC extension module to implement ( http://pecl.php.net/package/apc )
APC implementation:
Install APC, refer to the official documentation installed, you can use the PECL module installation method is rapid simple, no description here
Configure php.ini, set the parameters apc.rfc1867 = 1, to support the upload progress bar APC function, APC source code documentation there are instructions
Code Example:
Large files (50G) uploaded implementation details:
File server data processing logic receives the code:
2. Use PECL extension module uploadprogress implement ( http://pecl.php.net/package/uploadprogress )
uploadprogress module Method:
PECL module installation method used to install the module
php.ini which set uploadprogress.file.filename_template = "/tmp/upd_%s.txt"
Code Example:
The progress of the processing logic is simple, just update the data in the database on the line. It does not require additional treatment.
Client code as follows:
The server code is as follows:
Achieve effect after:
Powerful folders to upload, can easily support 10W-level folder upload.
Speed is also good
Resume file support, support refresh your browser, close the browser, then restart the computer is still able to resume.
理论上可以上传无限大的文件实时显示上传状态、进度支持多文件上传以及与表单混合上传方便的用户调用接口上传进度提供两种显示模式:新窗口或者内嵌式(0.3)多语言支持(0.21)兼容各种浏览器(经过测试的浏览器:IE5.0、IE6.0、Mozilla、Firefox、Opera)支持Mac、Linux。