Issue with uploading .eps file

328 views Asked by At

I can't figure out anything I'm missing. When I try to upload a eps file, I have got error, but the pdf and png files can able to upload.

if (isset($_FILES["picture"]["name"])) {
        $allowed = array('pdf', 'png', 'eps');
        $ext = pathinfo($_FILES["picture"]["name"], PATHINFO_EXTENSION);
        if (empty($_FILES["picture"]["name"])) {
            $fileErr = "Picture is required";
            $error = $error + 1;
        } else if (!in_array($ext, $allowed)) {
            $fileErr = "File format does not suppot.";
            $error = $error + 1;
        } else {
            $target_dir = "poster/";
            $target_file = $target_dir . basename($_FILES["picture"]["name"]);
            $uploded = move_uploaded_file($_FILES["picture"]["tmp_name"], $target_file);
            if(!$uploded){ $fileErr="Error";  }
        }

}

0

There are 0 answers