我已经更改了 php.ini 文件并在我的页面顶部添加了一个 set_time_limit(0),但我仍然无法使用 php 上传大文件。我也在使用 ajax 和 javascript 来上传,我可以上传 400Mb 的文件。我试图在 WAMP 上上传一个 3.2GB 的文件。
我的代码:
<?php
set_time_limit(0);
session_start();
include('../Connect/Connect.php');
$User = $_SESSION['User'];
$Files = $_FILES['File'];
if(isset($User))
{
if(!empty($Files))
{
for($X = 0; $X < count($Files['name']); $X++)
{
$Name = $Files['name'][$X];
$TMP = $Files['tmp_name'][$X];
move_uploaded_file($TMP, '../Users/' . $User . '/' . $Name);
}
}
}
else
{
header("location:../");
}
header("location:index.php");
$Connect->close();
?>