2012-07-05 60 views

回答

0

您可以使用APC並啓用rfc1867 setting apc.rfc1867

該網站解釋how to do it

<form method="post" action="upload.php" enctype="multipart/form-data"> 
    <div> 
     <input type="hidden" name="APC_UPLOAD_PROGRESS" value="1234" /> 
     <!--      ###################    --> 
     <input type="file" name="myFile" /> 
     <input type="submit" value="Upload file..." /> 
    </div> 
</form> 

注:APC_UPLOAD_PROGRESS表單元素必須出現在文件輸入之前的形式。

它會給你你需要的信息:

print_r(apc_fetch("upload_$_POST[APC_UPLOAD_PROGRESS]")); 
           ################### 

Array 
(
    [total] => 1142543 
    [current] => 1142543 
    [rate] => 1828068.8 
    [filename] => test 
    [name] => file 
    [temp_filename] => /tmp/php8F 
    [cancel_upload] => 0 
    [done] => 1 
) 
相關問題