$_FILES field 'tmp_name' has no value on .JPG file extension

前端 未结 7 2030
时光取名叫无心
时光取名叫无心 2020-11-29 07:53

i was making an upload script when i tested an image file wit this extension .JPG, i don\'t know whats the difference between jpg or jpeg, but it seems that $_FILES don\'t r

7条回答
  •  春和景丽
    2020-11-29 08:56

    Just try this and see what happens,

    if (($_FILES['file']['type']) == "image/jpg" || ($_FILES['file']['type']) == "image/jpeg") {
                          //do uploading stuff here
                        }else{
                        echo 'File is not a valid JPG,JPEG';
                        }
    

提交回复
热议问题