我有一些遗留代码,对于我的生活,我不明白为什么它突然停止工作。
非常基本的上传脚本:
if($_FILES['csvfile']['name']){
//if no errors...
if(!$_FILES['csvfile']['error']){
//now is the time to modify the future fle name and validate the file
$new_file_name = strtolower($_FILES['csvfile']['tmp_name']); //rename file
//move it to where we want it to be
move_uploaded_file($_FILES['csvfile']['tmp_name'], 'active_leads1.csv');
//echo 'Congratulations! Your file was accepted.';
}else{
//set that to be the returned message
//echo 'Ooops! Your upload triggered the following error: '.$_FILES['csvfile']['error'];
die("Unfortuanatly there was an error: {$_FILES['csvfile']['error']}");
}
}else{
die("Unfortuanatly there was an error: ".print_r($_FILES,true)."");
}
同样的形式也是基本的:
<form action="csvconvert.php" method="post" enctype="multipart/form-data">
<input type="file" name="csvfile" size="25" />
<input type="submit" name="submit" value="Submit" />
</form>
但是,它在11MB的文件上失败了。
检查了post限制和上传限制,两者都很好(256M和128M),最大输入时间是240,但是如果我print_r $_POST和$_FILES它们都是空的。
以前有人遇到过这个吗?任何帮助将不胜感激!
如果较小的文件是可以的,您确定您的upload_max_filesize
大于11MB吗?使用echo phpinfo();
时,upload_max_filesize
的值是多少?