Php 我的ipad只上传了.jpg格式,这是我的错吗?
如果我上传.png,我的上传脚本在我的笔记本电脑上就可以了。但是如果我尝试使用我的iPadiOS7.0.x,图像类型总是.jpgPhp 我的ipad只上传了.jpg格式,这是我的错吗?,php,ios,ipad,file-upload,Php,Ios,Ipad,File Upload,如果我上传.png,我的上传脚本在我的笔记本电脑上就可以了。但是如果我尝试使用我的iPadiOS7.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_word
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
Ps我知道这个脚本是不安全的,只是为了测试。你怎么知道你没有从iPad上传JPG?@GeorgeBrighton我下载了很多.png来测试