我有一个小上传脚本,它适用于正常大小的图像和文件。
function uploadimage($name,$dir)
{
if($name['error'] > 0){
die('An error ocurred when uploading.');
}
if(!getimagesize($name['tmp_name'])){
die('Please ensure you are uploading an image.');
}
// Check filetype
if($name['type'] != 'image/png'){
die('Unsupported filetype uploaded.');
}
// Check filesize
if($name['size'] > 500000){
die('File uploaded exceeds maximum upload size.');
}
// Check if the file exists
if(file_exists($dir. $name['name'])){
die('File with that name already exists.');
}
// Upload file
if(!move_uploaded_file($name['tmp_name'], $dir. $name['name'])){
die('Error uploading file - check destination is writeable.');
}
return $dir. $name['name'];
die('File uploaded successfully.');
}
$name 是 $_FILES['WHATEVER'] 和 $dir 目录。好吧,现在我只是更改了它的几行来上传 .csv 文件。到目前为止,一切都很好。它适用于小 .csv 文件。但是当我尝试更大的(20MB+)时,我发布它时没有任何反应。我检查了我的 php.ini 中的 upload_max_filesize 和 memory_limit,两者都是 128M ...有人可以给我一个指针,我应该在哪里搜索错误?