0

php (codeigniter): image uploading working properly in all devices but on working on iphone devices

Only iphone-captuered images are getting uploaded, but not working for non-captured/other images

My Code Snippet: (too lengthy code, I am just some part of that code)

<?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;
    }
    ....
    ....
?>

above php (codeigniter) script working properly for all devices but not working for iphone

Please suggest me the changes or idea to resolve this issue.

Vickel
  • 7,879
  • 6
  • 35
  • 56
Anjali Patil
  • 216
  • 1
  • 11
  • https://stackoverflow.com/questions/29733722/image-upload-not-working-in-codeigniter check this out may be it will helpful to you. – jilesh Feb 14 '20 at 06:31
  • I also "tft|TFT" added in allowed types.. but though its not working – Anjali Patil Feb 14 '20 at 06:44
  • https://stackoverflow.com/questions/5710352/codeigniter-image-upload-cant-get-error-message-to-show check this out to find error at upload time may be putting code of show error will help you to find out what issue you are facing. – jilesh Feb 14 '20 at 06:50

1 Answers1

1

In windows or android.. "jpg" auto-consider as "jpeg". But for iPhone, you have to mention it separately in "allow-types"

Rakesh Hiray
  • 721
  • 3
  • 15