锟斤拷 session.upload_progress.enabled INI 选锟筋开锟斤拷时锟斤拷PHP 锟杰癸拷锟斤拷每一锟斤拷锟侥硷拷锟较达拷时锟斤拷锟斤拷洗锟斤拷锟斤拷取锟� 锟斤拷锟斤拷锟较拷锟斤拷洗锟斤拷锟斤拷锟斤拷锟斤拷锟矫伙拷锟绞裁达拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷募锟斤拷洗锟绞庇︼拷每锟斤拷苑锟斤拷锟揭伙拷锟絇OST锟斤拷锟斤拷锟秸端o拷锟斤拷锟斤拷通锟斤拷XHR锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷状态
锟斤拷一锟斤拷锟较达拷锟节达拷锟斤拷锟叫o拷同时POST一锟斤拷锟斤拷INI锟斤拷锟斤拷锟矫碉拷session.upload_progress.name同锟斤拷锟斤拷锟斤拷时锟斤拷锟较达拷锟斤拷锟饺匡拷锟斤拷锟斤拷$_SESSION锟叫伙拷谩锟� 锟斤拷PHP锟斤拷獾斤拷锟斤拷锟絇OST锟斤拷锟斤拷时锟斤拷锟斤拷锟斤拷锟斤拷$_SESSION锟斤拷锟斤拷锟揭伙拷锟斤拷锟斤拷锟�, 锟斤拷锟斤拷锟斤拷 session.upload_progress.prefix 锟斤拷 session.upload_progress.name锟斤拷锟斤拷锟斤拷一锟斤拷锟街碉拷锟� 通锟斤拷锟斤拷些锟斤拷值锟斤拷锟斤拷通锟斤拷锟斤拷取INI锟斤拷锟斤拷锟斤拷锟斤拷茫锟斤拷锟斤拷锟�
<?php
$key = ini_get("session.upload_progress.prefix") . ini_get("session.upload-progress.name");
var_dump($_SESSION[$key]);
?>
通锟斤拷锟斤拷$_SESSION[$key]["cancel_upload"]锟斤拷锟斤拷为TRUE
锟斤拷锟斤拷锟斤拷锟斤拷取锟斤拷一锟斤拷锟斤拷锟节达拷锟斤拷锟叫碉拷锟侥硷拷锟较达拷锟斤拷
锟斤拷锟斤拷同一锟斤拷锟斤拷锟斤拷锟斤拷锟较达拷锟斤拷锟斤拷募锟斤拷锟斤拷锟斤拷锟斤拷锟饺★拷锟斤拷锟角帮拷锟斤拷诖锟斤拷锟斤拷锟侥硷拷锟较达拷锟斤拷未锟斤拷锟斤拷锟斤拷募锟斤拷洗锟斤拷锟斤拷锟斤拷遣锟斤拷锟斤拷瞥锟斤拷锟叫╋拷丫锟斤拷锟缴碉拷锟较达拷锟斤拷
锟斤拷一锟斤拷锟较达拷锟斤拷锟斤拷锟斤拷么取锟斤拷时锟斤拷$_FILES锟叫碉拷error锟斤拷锟结被锟斤拷锟斤拷为
UPLOAD_ERR_EXTENSION
锟斤拷
session.upload_progress.freq 锟斤拷 session.upload_progress.min_freq INI选锟斤拷锟斤拷锟斤拷锟斤拷洗锟斤拷锟斤拷锟斤拷锟较⒂︼拷枚锟矫憋拷锟斤拷锟铰硷拷锟斤拷一锟轿★拷 通锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷选锟斤拷锟街碉拷锟斤拷锟斤拷锟斤拷锟杰的匡拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆猴拷锟皆诧拷锟狡★拷
Example #1 锟斤拷锟斤拷锟斤拷息
一锟斤拷锟较达拷锟斤拷锟斤拷锟斤拷锟斤拷慕峁癸拷锟斤拷锟斤拷锟�
<form action="upload.php" method="POST" enctype="multipart/form-data"> <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="123" /> <input type="file" name="file1" /> <input type="file" name="file2" /> <input type="submit" /> </form>
锟斤拷session锟叫达拷诺锟斤拷锟斤拷菘锟斤拷锟饺ワ拷锟斤拷锟斤拷锟斤拷拥模锟�
<?php
$_SESSION["upload_progress_123"] = array(
"start_time" => 1234567890, // The request time
"content_length" => 57343257, // POST content length
"bytes_processed" => 453489, // Amount of bytes received and processed
"done" => false, // true when the POST handler has finished, successfully or not
"files" => array(
0 => array(
"field_name" => "file1", // Name of the <input/> field
// The following 3 elements equals those in $_FILES
"name" => "foo.avi",
"tmp_name" => "/tmp/phpxxxxxx",
"error" => 0,
"done" => true, // True when the POST handler has finished handling this file
"start_time" => 1234567890, // When this file has started to be processed
"bytes_processed" => 57343250, // Amount of bytes received and processed for this file
),
// An other file, not finished uploading, in the same request
1 => array(
"field_name" => "file2",
"name" => "bar.avi",
"tmp_name" => NULL,
"error" => 0,
"done" => false,
"start_time" => 1234567899,
"bytes_processed" => 54554,
),
)
);
为锟斤拷使锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟絯eb锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟襟缓筹拷锟斤拷锟斤拷要锟斤拷锟矫o拷锟斤拷锟斤拷 PHP锟斤拷锟杰斤拷锟斤拷锟侥硷拷锟斤拷全锟较达拷锟斤拷锟绞憋拷锟斤拷锟斤拷盏锟斤拷募锟斤拷洗锟斤拷锟斤拷锟� 锟斤拷知锟结缓锟斤拷锟斤拷锟街达拷锟斤拷锟斤拷某锟斤拷锟斤拷锟絅ginx锟斤拷