图片上传适用于除 iphone 以外的所有设备
image uploading works properly with all devices except iphone
php (codeigniter):图像上传在所有设备上正常工作,但在 iphone 设备上工作
仅上传 iphone 捕获的图像,但不适用于 non-captured/other 图像
我的代码片段:
(代码太长,我只是部分代码)
<?php
.....
.....
$this->load->library("upload");
$this->upload->initialize($this->set_upload_options());
if($this->upload->do_upload()){
$ppimagedata = $this -> upload -> data();
$ppnewimagename = $ppimagedata["file_name"];
$this -> load -> library("image_lib");
$config['image_library'] = 'gd2';
$config['source_image'] = $ppimagedata["full_path"];
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = FALSE;
$config['new_image'] = './uploads/Property/300X300/';
$config['width'] = 300;
$config['height'] = 300;
$this -> image_lib -> initialize($config);
$this -> image_lib -> resize();
}
private function set_upload_options() {
$config = array ();
$config ['upload_path'] = './uploads/Property';
$config ['allowed_types'] = 'gif|jpg|png';
return $config;
}
....
....
?>
以上 php (codeigniter) 脚本适用于所有设备但不适用于 iphone
请向我建议解决此问题的更改或想法。
在windows或android.. "jpg"自动考虑为"jpeg"。但是对于iPhone,你要在"allow-types"
中单独提及
php (codeigniter):图像上传在所有设备上正常工作,但在 iphone 设备上工作
仅上传 iphone 捕获的图像,但不适用于 non-captured/other 图像
我的代码片段: (代码太长,我只是部分代码)
<?php
.....
.....
$this->load->library("upload");
$this->upload->initialize($this->set_upload_options());
if($this->upload->do_upload()){
$ppimagedata = $this -> upload -> data();
$ppnewimagename = $ppimagedata["file_name"];
$this -> load -> library("image_lib");
$config['image_library'] = 'gd2';
$config['source_image'] = $ppimagedata["full_path"];
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = FALSE;
$config['new_image'] = './uploads/Property/300X300/';
$config['width'] = 300;
$config['height'] = 300;
$this -> image_lib -> initialize($config);
$this -> image_lib -> resize();
}
private function set_upload_options() {
$config = array ();
$config ['upload_path'] = './uploads/Property';
$config ['allowed_types'] = 'gif|jpg|png';
return $config;
}
....
....
?>
以上 php (codeigniter) 脚本适用于所有设备但不适用于 iphone
请向我建议解决此问题的更改或想法。
在windows或android.. "jpg"自动考虑为"jpeg"。但是对于iPhone,你要在"allow-types"
中单独提及