Ajax_upload Upload progress bar code implemented by PHP + apc + ajax

Source: Internet
Author: User
Tags apc apc module
This article mainly introduces the ajax_upload Upload progress bar code implemented by PHP + apc + ajax, and analyzes in detail the installation, setting, and ajax call of the apc module to implement the upload progress bar function, you can refer to the following example to describe the ajax_upload Upload progress bar code implemented by PHP + apc + ajax. We will share this with you for your reference. The details are as follows:

How is the upload progress bar implemented? What is the principle? When we browse and select upload, a temporary file will be generated. during the upload, the temporary file will be uploaded to the server. after the upload is complete, the temporary file will be deleted. If we can read the size of this temporary file, we will know the upload progress. The php apc module can implement this function.

1. install the apc module

: Http://pecl.php.net/package/apc

tar zxvf APC-3.1.8.tgzcd APC-3.1.8//usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make install

2. modify php. ini

extension = apc.soapc.rfc1867 = 1apc.max_file_size = 200Mupload_max_filesize = 1000Mpost_max_size = 1000Mmax_execution_time = 600max_input_time = 600memory_limit = 128M

After modification, restart apache or other services.

[root@BlackGhost php]# php -m[PHP Modules]apccgi-fcgictypecurldatedomeAccelerator。。。。。。。。

3. upload_test.php

<? Php $ id = uniqid (rand (), true);?>

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.