欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 一。 APC模块的安装与配置 我的环境是Windows,需要去下载php_apc. dll文件,并把php_apc.dll放到php/ext中,并在php.ini中添加以下语句: extension = php_apc.dll apc.rfc1867 = 1 apc.max_file_siz
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入
一。 APC模块的安装与配置
我的环境是Windows,需要去下载php_apc. dll文件,并把php_apc.dll放到php/ext中,并在php.ini中添加以下语句:
extension = php_apc.dll
apc.rfc1867 = 1
apc.max_file_size = 200M
另外,由于需要上传大文件,所以,在php.ini中,以下选项也需要更改:
upload_max_filesize = 1000M
post_max_size = 1000M
max_execution_time = 600 ;每个PHP页面运行的最大时间值(秒),默认30秒
max_input_time = 600 ;每个PHP页面接收数据所需的最大时间,默认60秒
memory_limit = 128M ;每个PHP页面所吃掉的最大内存,默认8M
二。 获取进度条代码
getprogress.php
session_start();
if(isset($_GET['progress_key'])) {
$status = apc_fetch(‘upload_'.$_GET['progress_key']);
if($status['total']!=0 && !emptyempty($status['total'])) {
echo json_encode($status);
}
else {
echo (0);
}
}
?>
session_start();
if(isset($_GET['progress_key'])) {
$status = apc_fetch('upload_'.$_GET['progress_key']);
if($status['total']!=0 && !empty($status['total'])) {
echo json_encode($status);
}
else {
echo (0);
}
}
?>
这里用到了json,传数据非常方便。
$status对象是拥有以下字段的数组:
total: 文件总大小
current: 到目前为止收到的文件数
rate: 上传速度(以字节/秒为单位),不过要在上传完成之后才能有。
filename: 文件名
name: 变量名
temp_filename: PHP 保存文件的临时副本的位置
cancel_upload: 上传已取消(1),还是未取消(0)
done: 上传已完成(1),还是尚未完成(0)
这里,我们用json全部传到页面,方便后面利用。
三。 主文件
upload.php
$id = md5(uniqid(rand(), true));
?>
“width: 500px; height: 20px; border: 1px solid black; display:none;”>
“position: relative; height: 20px; background-color: gray; width: 0%; ”>
[1] [2]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.