PHP uses the APC module to implement a large file Upload progress bar

Source: Internet
Author: User
Tags apc apc module file upload progress bar
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.