需要获取上传文件的尺寸,例如宽度、高度、大小等。我尝试使用getimagesize()
,但这不起作用。我得到一个错误,
Warning: getimagesize(C:/wamp/www/KSHRC/uploads/): failed to open stream: No such file or directory in C:\wamp\www\KSHRC\registration\multi_fileupload.php on line 31
和
Notice: Array to string conversion in C:\wamp\www\KSHRC\registration\multi_fileupload.php on line 31
这是代码,
for($i=0; $i < count($_FILES['userfile']['tmp_name']);$i++)
{
$root = $_SERVER['DOCUMENT_ROOT']."/KSHRC/uploads/";
$filename = $_FILES['userfile']['name'][$i];
echo $size = getimagesize($root.$filename);
}
请帮我..