我的ipad只以.jpg格式上传这是我的错吗?

时间:2014-02-22 20:21:00

标签: php ios ipad file-upload

我的笔记本电脑上的上传脚本很好,如果我上传.png它会显示.png但如果我尝试使用我的ipad ios 7.0.x,图像类型总是.jpg

if ( isset( $_FILES["image_file"] ) ) {

    $image_file = $_FILES["image_file"]["name"];
    $image_ext = pathinfo( $image_file, PATHINFO_EXTENSION );
    $image_name = remove_bad_words( str_replace( " ", "_", $title ), "/[^a-zA-Z0-9\s_]/" ) . "." . $image_ext;
    $folder_location = "../images/tech/";

    if ( $_FILES["image_file"]["error"] > 0 ) {

        $errors[] = $_FILES["image_file"]["error"];
    }

    if ( file_exists( $folder_location . $image_name ) ) {

        $_SESSION["message"] .= "{$image_name} already exists, ";

    } else {

        $_SESSION["message"] .= "{$image_name} was uploaded successfully, ";

        move_uploaded_file( $_FILES["image_file"]["tmp_name"],  $folder_location . $image_name );
    }
}

是我还是我的ipad?

我知道这个脚本不安全,不能用于测试目的。

0 个答案:

没有答案