我有这个代码:
$name="dsds"
if(isset($_FILES))
{
$imagename = $_FILES['uploadimage'].$name;
$imagetype = $_FILES['uploadimage'].$type;
$imagesize = $_FILES['uploadimage'].$size;
if($imagetype != "image/gif" || $imagetype != "image/jpg" || $imagetype == "image/png" || $imagetype == "image/jpeg")
{
$error = 'Please upload an image with JPG, PNG, GIF';
}
elseif($imagesize > 716800)
{
$error = 'Image Needs to be under 700kb only';
}
else
{
$success = 'Uploaded';
}
但有时它会上传图像,但会在文件名中添加“Array”,有时它根本不起作用。