上传.eps文件的问题

时间:2014-11-14 06:12:25

标签: php file-upload eps

我无法弄清楚我错过了什么。当我尝试上传eps文件时,我遇到了错误,但pdf和png文件可以上传。

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 个答案:

没有答案