This article describes how to use the APC module in PHP to implement a large file Upload progress bar, and provides related configuration instructions. interested users can learn from this article. Php large file upload with progress has always been a headache for php programmers. Query baidu and Google. Generally, the upload method with progress is flash + php, socket, apc + php, etc. below I will introduce
Apc + php + ajax-based Upload with progressAnd post the source code, hoping to be useful to everyone.
Alternative PHP Cache (APC) is a free and public PHP optimized code Cache. It is used to provide free, public, and robust architectures to cache and optimize PHP intermediate code.
When using apc, you must first install the apc module.
Step 1: Download php_apc.dll
Step 2: Let php. ini support the apc extension module.
Put php_apc.dll in your ext directory, and then open php. ini to add:
Extension = php_apc.dll
Apc. rfc1867 = on
Apc. max_file_size = 100 M
Upload_max_filesize = 100 M
Post_max_size = 100 M
// You can customize the preceding parameters.
Step 3: Check whether php apc is supported
if (function_exists('apc_fetch')) { echo 'it surpport apc model!'; } else { echo "it's not support apc model!"; } ?>
Enter the subject below:
Principle:Use the APC module to read the upload progress from the cache using ajas. For details, see:
Index. php
<? Php $ unid = uniqid (""); // determine the unique flag to enable simultaneous uploads by multiple users?>
Upload the software you want to upload to the server first. please wait...