2010-01-04 163 views

回答

3

move_uploaded_file()的手冊頁中的示例可以做什麼?

$uploads_dir = '/uploads'; 
foreach ($_FILES["pictures"]["error"] as $key => $error) { 
    if ($error == UPLOAD_ERR_OK) { 
     $tmp_name = $_FILES["pictures"]["tmp_name"][$key]; 
     $name = $_FILES["pictures"]["name"][$key]; 
     move_uploaded_file($tmp_name, "$uploads_dir/$name"); 
    } 
} 

也可參閱Handling File Uploads章PHP手冊中

相關問題