我想使用PHP和Apache服务器上传大约150 MB的文件.使用我的代码,我可以上传高达5MB
<?php
$path = $_COOKIE['Mypath'];
$target_path = "uploads/".$path ;
if(!isDir($target_path))
{
mkdir($target_path);
}
# Do uploading here
$target_path = "uploads/".$path ."/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
header("Location: somepage.html");
}
else
{
echo "File not uploaded";
}
?>
Run Code Online (Sandbox Code Playgroud)
php.ini中
max_execution_time = 300 ; Maximum execution time of each script, in seconds
max_input_time = 300 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit …Run Code Online (Sandbox Code Playgroud)