if (isset($_FILES['upload']['name']))
{
$fcount = count($_FILES['upload']['name']);
for ($i = 0; $i < $fcount; $i++)
{
$fname = $_FILES['upload']['name'][$i];
$path_parts = pathinfo($fname);
if (strtolower($path_parts['extension']) != 'ppt')
{
echo $_FILES['upload']['name'][$i] . ' 不是ppt文件.
' ;
}
}
for ($i = 0; $i < $fcount; $i++)
{
$fsize = (int)$_FILES['uplode']['size'][$i];
if ($fsize > 2048576)
{
echo '文件超过指定的大小: ' . $_FILES['upload']['name'][$i] . ":" . $fsize . '
';
}
}
for ($i = 0; $i < $fcount; $i++)
{
$ferror = $_FILES['uplode']['error'][$i];
if ($ferror)
{
echo '文件上传错误: ' . $_FILES['upload']['name'][$i] . ":" . $ferror. '
';
}
}
} else
{
echo '上传文件不正确.';
}
?>