HTML/PHP File Upload

后端 未结 5 1257
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 21:46

So i want the user to only be able to upload docs or docx\'s. So first here\'s my html:

5条回答
  •  悲&欢浪女
    2020-12-19 22:20

    Your file field name is img and you have used $_FILES["file"], but it should be $_FILES["img"].

    Also you need to change your if condition

    if (($_FILES["file"]["size"] < 200000)
        && in_array($extension, $allowedExts)) {
    

    There is no need of

    $extension!=".doc" || $extension!=".doc" &&

提交回复
热议问题