我有一个表格来上传文件,检查它是否到达的代码在这里:
if (is_uploaded_file($_FILES['foto'] ['tmp_name'])){
echo "file is valid and was uploaded";
print_r($_FILES);
}
它说:
file is valid and was uploadedArray ( [foto] =>
Array ( [name] => Penguins.jpg [type] => image/jpeg [tmp_name]
=> /var/www/uploads/phpf8ECTX [error] => 0 [size] => 777835 ) )
Array ( [foto] => Array ( [name] => Penguins.jpg [type] => image/jpeg [tmp_name]
=> /var/www/uploads/phpf8ECTX [error] => 0 [size] => 777835 ) ) array(1) {
["foto"]=> array(5) { ["name"]=> string(12) "Penguins.jpg" ["type"]=> string
(10) "image/jpeg" ["tmp_name"]=> string(26) "/var/www/uploads/phpf8ECTX" ["error"]
=> int(0) ["size"]=> int(777835) } }
但文件没有到达,php.ini 配置正确,/var/www/uploads 目录有权为所有用户写入,我在 linux 中运行 apache2,知道有什么问题吗?谢谢你