ファイルのアップロードを処理するスクリプトがあります。 1 MB未満のファイルをアップロードしましたが、ファイルが1 MBを超えると、スクリプトは一時ファイルパスをnullに設定しているようです。以下にスクリプトを示します。PHP - Tempファイルのパスがnullです
$total = count($_FILES['DocName']['tmp_name']);
for($i = 0; $i < $total; $i++) {
// Get the temp file path
$tmpFilePath = $_FILES['DocName']['tmp_name'][$i];
// Check if we have a path
if ($tmpFilePath != "") {
// Variables from form
$FolderName = $_POST['FolderName'];
$FolderName = stripslashes($FolderName);
$FolderName = mysql_real_escape_string($FolderName);
//Setup our new file path
// Check if folder name is home, if so, set the file path to that folder
if ($FolderName == "Home") {
$target_dir = "../../cdn.brmbc.com/usercontent/".$UserID."/";
}
// If the folder name is not home, make the file go to that folder
else {
$IsInFolder = 1;
$target_dir = "../../cdn.brmbc.com/usercontent/".$UserID."/".$FolderName."/";
}
$target_file = $target_dir . basename($_FILES["DocName"]["name"][$i]);
$FileType = pathinfo($target_file,PATHINFO_EXTENSION);
$DocumentName = $_FILES["DocName"]["name"][$i];
echo $tmpFilePath . "<br>";
echo $target_file . "<br>";
echo $FileType . "<br>";
echo $DocumentName . "<br>";
}
// Go home if there is no temp path
else {
echo $tmpFilePath . "<br>" . "Failed to upload";
}
}
コードに誤りがありますか、これは単なるサーバーの問題ですか?