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. 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.
You can refer to this article: http://blog.ncmem.com/wordpress/2019/08/12/php-%e5%a4%a7%e6%96%87%e4%bb%b6%e4%b8%8a % e4% bc% a0% e7 % 9a% 84% e5% ae% 9e% e7% 8e% b0 /